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!