Dear group, I need help on two problems:
1. I am trying to plot density plots for each individual in 8 occasions. I can do this by subject wiht the code below: par(mfrow=c(4,2)) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==0])) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==1])) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==10])) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==11])) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==100])) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==101])) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==110])) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==111])) I have total of 100 subjects and I want to automate this and create for every subject. 2. I want to also plot each subject in the same plot for all 8 scenarios instead of the way I am doing above. Could you please help me with the coding? I tried sm.densityplot.compare but it is giving me an error: missing data are removed missing data are removed Error in if (opt$nbins > 0) { : missing value where TRUE/FALSE needed In addition: Warning message: In cbind(X, group) : number of rows of result is not a multiple of vector length (arg 2) I appreciate your help. Regards, Ayyappa [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.