I have to fit a linear model for
E(ᴪ(Y)) = β0+ β1X1+ β2X2+ β3X3
where ᴪ is a modified Box-Cox transformation given by:
and β0,1,2,3 are parameters. My data frame is a shown as below which I read into R as
data<-read.table("surveydata.txt", header=TRUE)
I'm fairly new to R and I haven't been able to fit the model. I know how to fit a model using using lm, but wasn't sure how I'll fit it while including the transformation and the expectation.
So far I've tried:
>lm(mean(boxcox(Y))~X1+X2+X3,data)
Error: $ operator is invalid for atomic vectors