Hi everyone,
I have got a command for R, however, I am using Stata. I am not familiar with R, only with Stata. I can't use the code in R and use that data in Stata, because I must have the command. Is there someone who has experience with both Stata and R and can provide me with help to convert the command below?
Most=rep(0, length(AB))
for (i in 1:length(AB)){
if (AB[i]==3)Most[i]=1
if (AC[i]==3)Most[i]=1
if (AC[i]==4)Most[i]=1
if (AD[i]==4)Most[i]=1
if (AD[i]==5)Most[i]=1
if (AE[i]==4)Most[i]=1
if (AE[i]==5)Most[i]=1
if (AF[i]==4)Most[i]=1
if (AF[i]==5)Most[i]=1
if (AG[i]==4)Most[i]=1
if (AG[i]==5)Most[i]=1
}
Thank you for you help in advance!
I have got a command for R, however, I am using Stata. I am not familiar with R, only with Stata. I can't use the code in R and use that data in Stata, because I must have the command. Is there someone who has experience with both Stata and R and can provide me with help to convert the command below?
Most=rep(0, length(AB))
for (i in 1:length(AB)){
if (AB[i]==3)Most[i]=1
if (AC[i]==3)Most[i]=1
if (AC[i]==4)Most[i]=1
if (AD[i]==4)Most[i]=1
if (AD[i]==5)Most[i]=1
if (AE[i]==4)Most[i]=1
if (AE[i]==5)Most[i]=1
if (AF[i]==4)Most[i]=1
if (AF[i]==5)Most[i]=1
if (AG[i]==4)Most[i]=1
if (AG[i]==5)Most[i]=1
}
Thank you for you help in advance!
Comment