On Wed, Mar 23, 2011 at 1:17 PM, Michal Figurski <figur...@mail.med.upenn.edu> wrote: > Dear R-helpers, > > This may sound simple to you, but I'm a beginner in this, so please be > forgiving. > I have a following problem: two analytes were measured in patient's blood on > 4 occasions: ProteinA and ProteinB. How to correctly evaluate correlation > between ProteinA and ProteinB? > > I tried: > x <- data.frame(Patient.ID=rep(1:10, each=4), Visit=rep(c(1:4),10), > ProteinA=rnorm(m=10, n=40), ProteinB=rnorm(m=13,s=0.7,n=40))
simply use cor(x$ProteinA, x$ProteinB) If you want a p-value and confidence intervals, use cor.test(x$ProteinA, x$ProteinB) Peter ______________________________________________ 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.