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
Identifying causes of multicollinearityHi! We are struggling with high VIF's in our model (in which we are using panel data with our main …
Causal Mediation on imputed dataDear Statalisters, To carry causal Mediation analysis, I am using the Mediation package (Medeff com…
Difference-in-Difference Regression with multiple time periodsDear Statalists, I am currently investigating Acquirer Performance before and after M&A deals. …
How to remove the average from marginplotHello, I got 2 continous variables with an interaction, I'm trying to visualise that as a graph, h…
countries and longitudinal dataDear Statalisters, I have a dataset, which involves the fifth wave of SHARE DATA and I want to exam…
Subscribe to:
Post Comments (Atom)
0 Response to Creating polynomial expansion of a variable
Post a Comment