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
Error message: Repeated time values within panelHi, I am struggling to understand why I am unable to xtset my panel data. I have used the Understa…
Error message: no room to add more variablesHi all, I am trying to combine three DHS surveys by appending them all using following command. us…
Combining MICE with predictive mean matchingI am trying to multiply impute n=30 data sets, and I am hoping to do this using both chained equatio…
How to "table" into a putdocx or otherDear all, I am using Stata 16 and dealing with several descriptive stats as well as graphs, and I ne…
Creating plots to investigate non-linear effectsHi, I'm having trouble creating and understanding plots that show a non-linear effect and how this …
Subscribe to:
Post Comments (Atom)
0 Response to Linear regression
Post a Comment