[R] Scripting Problem--Linear Regression Using Logit of the Response Variable
John, Larry
Larry.John at anser.org
Thu Jan 7 21:22:22 CET 2016
Dear fellow citizens of the R-verse,
I'm a non-quant analyst trying to do some statistical analyses on a large data set unimaginatively named "data."
sympathy trust fear greed sharer_prob
[1] 3 2 0 0 0.669593
[2] 2 1 2 3 0.669593
[3] 2 2 2 3 0.494675
[4] 2 2 1 2 0.494675
[5[ 2 2 2 0 0.556837
[6] 2 2 1 1 0.556837
"sharer_prob" is the continuous dependent variable with values 0 > sharer_prob > 1, so I know need to run a logit transformation before I can do any linear regressions to study the main and interaction effects of the four independent variables.
I've loaded "car" and tried for several hours to create a one-line script that will give me the overall linear model, but keep having problems. It seems to me that something like the following should work
> EvacLM <- lm((logit(sharer_prob) ~ sympathy + trust + fear + greed) adjust=TRUE) na.action=NULL)
But R politely tells me I've gotten something wrong:
Error: unexpected symbol in "EvacLM <- lm((logit(sharer_prob) ~ sympathy + trust + fear + greed) adjust"
I'm hoping one of you can spot and help me correct my mistake-I sure can't figure it out.
Thanks for any help you can offer!
Larry John
Principal Analyst
ANSER (www.anser.org)
[[alternative HTML version deleted]]
More information about the R-help
mailing list