Hi Michael,

May be you have NA on your dataset.


x<-runif(20)
y<-runif(20)

cor(x,y)

x[10]<-NA
x

cor(x,y) # SEE the error because NA
cor(x,y, use = "pairwise.complete.obs")

Good luck,

miltinho
brazil



On 6/23/08, Tong, Michael <MTONG@templeton.com> wrote:
>
> Hi,
>
> I have recently been using the R program and encountered a recurring
> problem. I have been trying calculate the correlation of a 16 column table.
> Everytime I type in cor(test), where test is data that I uploaded into R
> using the read.table function, I get an error:
>
> Error in cor(test) : missing observations in cov/cor
> In addition: Warning message:
> In cor(test) : NAs introduced by coercion
>
> Can anyone tell me what I am doing wrong and what I need to do to correct
> this?
>
> Also I intend on running the T-Stats, P-Stats, Information Coefficient and
> Information Ratios once I get the correlation table calculated. If you know
> which packages, if any, have are able to calculate this, that would be
> helpful.
>
> Thanks.
>
> Best,
>
> Michael Tong
> Futures Associate
> Quantitative Research Services
> Franklin Templeton Investments, Inc.
> 600 Fifth Ave
> New York, NY 10020
> (212) 632-4254
> mtong@templeton.com
>
> Notice:  All email and instant messages (including attachments) sent to
> or from Franklin Templeton Investments (FTI) personnel may be retained,
> monitored and/or reviewed by FTI and its agents, or authorized
> law enforcement personnel, without further notice or consent.
>
>        [[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.
>

	[[alternative HTML version deleted]]

