Displaying 1 result from an estimated 1 matches for "zjiaqi19880219".
2013 Feb 02
1
Why replacement has length zero? And How can I fix it?
...for (i in 1:Sample.Size){
if (DataSet$SES[i]>0) {
IAP[i] <- ifelse(runif(1)>0.75, 1, 0) # High SES, higher chance to be in
Treatment #
}
else {
IAP[i] <- ifelse(runif(1)<=0.25, 1, 0) # Low SES, lower chance to be in
Treatment #
}
} # End loop #
IAP
IAP
zjiaqi19880219 wrote
> Hi, all,
>
> I am working on a project to run a simulation. I am now working on the
> main body of the simulation body, I generate the data and all work well
> before I identify a variable "IAP", there is always an error message as
> "replacement has length...