Dear Statalist,
What I want to do is to create a polynomial expansion of a certain degree of two variables k and i in such a way to approximate an unknown function g(k,i). Is there a function in Stata? Doing that manually is quite time consuming and it is dangerous since you can forget some terms easily.
Manually it is (for a polynomia of degree 4): gen phi= i+i*k+i*k*k+i*k*k*k + i*i+ +i*i*k*k+i*i*k+i*i*i+i*i*i*k+k*k*k*k+i*i*i*i
Thank you for your help,
Gino
Related Posts with Creating polynomial expansion of a variable
f test following reghdfe for joint significance of individual fixed effectsHi all, I'd like to run a f-test to test joint significance of each fixed effects. For example, I'd…
Decomposing regression into within and between effectsConsider the following baseline model: yijk = beta * xijk + errorijk where i indicates a child, j i…
Implied Cost of Equity, mm_root function skips the results of some observationsHi There, I have used the following codes to calculate the implied cost of equity. While the code c…
Losing Precision with ASEC ID ValuesHi Statalisters, I'm currently working with the 2019 CPS ASEC, trying to match individual responden…
Flexible parametric modelling, models do not convergeHi, I’m using the -stpm2- command to generate a flexible parametric model (relative survival, >1…
Subscribe to:
Post Comments (Atom)
0 Response to Creating polynomial expansion of a variable
Post a Comment