Re: [R] Request for functions to calculate correlated factors influencing an outcome.

2015-05-04 Thread Prashant Sethi
Hi, >From my understanding of a model, you need to have one or more dependent parameter variables which you (y1, y2 etc) and the explanatory parameter variables (x1, x2 etc) which you fit along with certain coefficients to determine the dependent parameter with minimum error as possible. I don't t

Re: [R] Request for functions to calculate correlated factors influencing an outcome.

2015-05-04 Thread Bert Gunter
This would be better posted on a statistical list like stats.stackexchange.com, as it is largely about statistical methodology, not R code. Once you have determined what kinds of methods you want, you might then post back here -- or better yet, just search! -- for packages that implement those meth

Re: [R] Request for functions to calculate correlated factors influencing an outcome.

2015-05-04 Thread Lalitha Viswanathan
Hi I used the MASS library library(MASS) (by reading about examples at http://www.statmethods.net/stats/regression.html ) fit <- lm(Mileage~Disp+HP+Weight+Reliability,data=newx) step <- stepAIC(fit, direction="both"

Re: [R] Request for functions to calculate correlated factors influencing an outcome.

2015-05-03 Thread Prashant Sethi
Hi, I'm not an expert in data analysis (a beginner still learning tricks of the trade) but I believe in your case since you're trying to determine the correlation of a dependent variable with a number of factor variables, you should try doing the regression analysis of your model. The function you

[R] Request for functions to calculate correlated factors influencing an outcome.

2015-05-03 Thread Lalitha Viswanathan
Hi I am sorry, I saved the file removing the dot after the Disp (as I was going wrong on a read.delim which threw an error about !header, etc...The dot was not the culprit, but I continued to leave it out. Let me paste the full code here. x<-read.table("/Users/Documents/StatsTest/fuelEfficiency.txt

Re: [R] Request for functions to calculate correlated factors influencing an outcome.

2015-05-03 Thread Michael Dewey
Dear Lalitha, see inline below On 03/05/2015 10:19, Lalitha Viswanathan wrote: Hi I have a dataset of the type attached. Here's my code thus far. dataset <-data.frame(read.delim("data", sep="\t", header=TRUE)); newData<-subset(dataset, select = c(Price, Reliability, Mileage, Weight, Disp, HP));

[R] Request for functions to calculate correlated factors influencing an outcome.

2015-05-03 Thread Lalitha Viswanathan
Hi I have a dataset of the type attached. Here's my code thus far. dataset <-data.frame(read.delim("data", sep="\t", header=TRUE)); newData<-subset(dataset, select = c(Price, Reliability, Mileage, Weight, Disp, HP)); cor(newData, method="pearson"); Results are Price Reliability