I have squared root the dependent variable to deal with the non-normally distributed residuals. The dependent variable is measured in centimetres, so the values for the dependent variable are greater than 0. All the independent variables are dummy variables. My sample size is 1000. After running the linear regression and estimating the margins, I transformed the margins back to the original values. I have used this command:
generate generate sqrtindep1=sqrt(indep1)
repress dependent i.sqrtindep1 i.indep2 i.indep3 i.indep4
margins sqrtindep1, expression(predict(xb)^2)"
I have read also instead of transforming the dependent variable I can use glm with link power and then estimate margins. However, the estimated margins from glm are different from the liner regression. Any advice why the margins are different and which model is more appropriate?
glm dependent i.indep1 i.indep2 i.indep3 i.indep4 , link(power 0.5)
margins indep1
Related Posts with Linear regression
Exporting Stata results to RI would like to use Stata and get results from analyses into R (as a data frame in R, for manipulati…
Stata 16 describe command - file size is gone?Dear all Running an updated Stata 16 MP version, I notice that the Code: describe command is miss…
Increase number of characters displayed in value label for svy tab?When using svy tab for survey weights, the label cut off is 8 characters, In regular tab, it's somet…
Reshape from wide to long in multiple stepsDear Listers, I have some trouble reshaping a set of country specific variables that I need to merg…
Writing nested foreach loop to convert many .txt files to .dtaI'm trying to write a foreach loop to convert a few hundred text files, divided up into many folders…
Subscribe to:
Post Comments (Atom)
0 Response to Linear regression
Post a Comment