Re: [R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread huang jialin
s to construct some toy data. Even if imperfect, people will work > to > > help you. Maybe show us some of your actual data. > > > > ** ** > > > > > Of course, if a and b1 are really scalars, I don’t think there is such a > > thing as the covariance between two scalars > > >

Re: [R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread Mark Lamias
ours,   Mark J. Lamias From: huang jialin To: "Doran, Harold" Cc: "r-help@r-project.org" Sent: Monday, March 12, 2012 12:08 PM Subject: Re: [R] how to calculate a variance and covariance matrix for a vector Doran, Thanks for your advice. Since

Re: [R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread huang jialin
.@gmail.com] > *Sent:* Monday, March 12, 2012 11:53 AM > *To:* Doran, Harold > *Cc:* r-help@r-project.org > *Subject:* Re: [R] how to calculate a variance and covariance matrix for > a vector > > ** ** > > Hi, > > ** ** > > Thanks for your response.

Re: [R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread Doran, Harold
between two scalars From: huang jialin [mailto:huangps...@gmail.com] Sent: Monday, March 12, 2012 11:53 AM To: Doran, Harold Cc: r-help@r-project.org Subject: Re: [R] how to calculate a variance and covariance matrix for a vector Hi, Thanks for your response. I tried to use cov() before, but

Re: [R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread huang jialin
ect.org] > On > > Behalf Of huang jialin > > Sent: Monday, March 12, 2012 11:43 AM > > To: r-help@r-project.org > > Subject: [R] how to calculate a variance and covariance matrix for a > vector > > > > Hello, > > > > I have a vector {a, b1, b2, b3

Re: [R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread Doran, Harold
Behalf Of huang jialin > Sent: Monday, March 12, 2012 11:43 AM > To: r-help@r-project.org > Subject: [R] how to calculate a variance and covariance matrix for a vector > > Hello, > > I have a vector {a, b1, b2, b3, b4}. How can I calculate the following > matrix: > >

Re: [R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread R. Michael Weylandt
On Mon, Mar 12, 2012 at 11:42 AM, huang jialin wrote: > Hello, > > I have a vector {a, b1, b2, b3, b4}. What does this mean? Is this a character vector giving names of objects that exist elsewhere in the workspace? Else, how do you tell a/b1/b2 apart in a vector? You probably want ?cov but apply

Re: [R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread Jorge I Velez
?cov HTH, Jorge.- On Mon, Mar 12, 2012 at 11:42 AM, huang jialin <> wrote: > Hello, > > I have a vector {a, b1, b2, b3, b4}. How can I calculate the following > matrix: > > var(a) cov(a, b1) cov(a, b2) cov(a, b3) cov(a, b4) > cov(a, b1) var(b1) cov(a, b2) cov(a, b3) cov(a, b4) > ... > ..

[R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread huang jialin
Hello, I have a vector {a, b1, b2, b3, b4}. How can I calculate the following matrix: var(a) cov(a, b1) cov(a, b2) cov(a, b3) cov(a, b4) cov(a, b1) var(b1) cov(a, b2) cov(a, b3) cov(a, b4) ... ... cov(a, b1) cov(a, b2) cov(a, b3) cov(a, b4) var(b4) I would very appreciate your inputs.