I've got this table: A B 1 7.8 215 2 6.8 280 3 9.4 356 4 5.2 38 5 8.2 167 6 4.8 127 7 3.7 8 8 6.2 201 9 9.7 346 10 8.1 241 how can I get the variance and covariance of A and B? -- View this message in context: http://r.789695.n4.nabble.com/how-to-get-variance-tp3232523p3232523.html Sent from the R help mailing list archive at Nabble.com.
The answer is ?cor but this question is not really appropriate for this list. Read one of the fine introductions to R, and turn to this list only when you get stuck. -Best, Ista On Sun, Jan 23, 2011 at 1:25 PM, kiotoqq <kiotoqq at googlemail.com> wrote:> > I've got this table: > > > ? ? A ? B > 1 ?7.8 215 > 2 ?6.8 280 > 3 ?9.4 356 > 4 ?5.2 ?38 > 5 ?8.2 167 > 6 ?4.8 127 > 7 ?3.7 ? 8 > 8 ?6.2 201 > 9 ?9.7 346 > 10 8.1 241 > > how can I get the variance and covariance of A and B? > -- > View this message in context: http://r.789695.n4.nabble.com/how-to-get-variance-tp3232523p3232523.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >-- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org
On Jan 23, 2011, at 8:25 AM, kiotoqq wrote:> > I've got this table: > > > A B > 1 7.8 215 > 2 6.8 280 > 3 9.4 356 > 4 5.2 38 > 5 8.2 167 > 6 4.8 127 > 7 3.7 8 > 8 6.2 201 > 9 9.7 346 > 10 8.1 241 > > how can I get the variance and covariance of A and B??var (If that hadn't been your first guess, you could always have tried: ??covariance But maybe not: RSiteSearch(covariance) # the term is ubiquitous in statistics documents ... and I'm guessing that the number of choices offered would be a lot smaller on someone's machine who is just starting out and has few extra packages installed than it was on my machine. I think maybe you need to do some more self-study of the "Introduction to R" document). -- David Winsemius, MD Heritage Laboratories West Hartford, CT