Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I'm trying to add a random perturbation term to my response variable (to estimate the impact of multicolinnearity in the beta estimates), but I am not sure on how to accomplish it when the response variable is transformed using a 1/4 power, in R.

Without any transformation in the response variable, according to Faraway's "Linear Models with R," the way to write it is:

g <- lm(hipcenter+10*rnorm(38) ~ ., seatpos). 

So if I have a 1/4 power transformation for the response variable, then the code should be:

g <- lm((hipcenter^(1/4))+10*rnorm(38) ~ ., seatpos). 

Is this right?

share|improve this question
Why don't you construct another variable in your data.frame that is transformed and use that one in your model? Something along the lines of seatpos$hipcenter_trans <- seatpos$hipcenter^(1/4) + 10 * rnorm(38). To answer your question, yes, you are powering your variable and adding some noise that has mean of ~0 and SD of 10. – Roman Luštrik Aug 31 '12 at 8:35
1  
Are you aware of the perturb package in R? It seems to do exactly what you want. – Peter Flom Aug 31 '12 at 10:36
I just wanted to thank Roman and Peter for their helpful advice. – Dan Sep 1 '12 at 19:30

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.