Hello all,
I am running a non-linear regression that looks like this:
vcemway reg ln_y x x^2 i.year FE1 FE 2 FE3, cluster(region year)
I then use the regression coefficients to predict E(Y | X) as follows:
gen beta_S = _b[x]
gen beta_S_sq = _b[x^2]
gen beta_cons = _b[_cons]
gen FE1_mem = _b[hh_members]
gen FE2_KasP =_b[region1]
gen FE3_KusP =_b[region2]
gen share_gen = exp(beta_cons + rand_S*beta_S + rand_S*rand_S*beta_S_sq + FE1_mem + FE2_KasP + FE3_KusP)
Here, rand_S is a variable containing random values of my random variable.
*Output graph*
graph twoway (lpoly share_gen rand_S)
My question is, how can I compute the upper and lower bounds of the confidence intervals to include them in the graph? I am looking to create new variables and plotting them using lpoly.
Any other suggestions would also be welcome! Thank you very much in advance!
Related Posts with Quadratic regression: adding CI to lpoly graph
New package cdfquantreg01 on SSCDear Statalisters: I have contributed this module to SSC (thanks to Kit Baum): cdfquantreg01: Stata …
How to add average treatment effect line in event study plotDear community, I want to add the average treatment effect (and confidence interval) when plotting …
How to create a child number indicator?Hi all, Everyone was really helpful on my last post. Currently, I have a dataset that has parents (…
Unable to use etable command on stata 17I am attempting to use etable command documented here --> https://www.stata.com/manuals/retable.p…
New package: rowsumHi Everyone, I write a new package called "rowsum" (my first package : ). It sums the values of mul…
Subscribe to:
Post Comments (Atom)
0 Response to Quadratic regression: adding CI to lpoly graph
Post a Comment