-1

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
Bhargav Rao
  • 45,811
  • 27
  • 120
  • 136

1 Answers1

1
boxcox(Y ~ X1 + X1 + X3, data, plotit = F)$y
David Arenburg
  • 89,637
  • 17
  • 130
  • 188