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
 How to make of use loop in this caseDear all,
I would like to seek your advice on the use of loop or other equivalent functions. My dat… How to make of use loop in this caseDear all,
I would like to seek your advice on the use of loop or other equivalent functions. My dat…
 create dummy variables for children educationHi
I want to create four separate dummy variables at household level:
1. No children between 5 and … create dummy variables for children educationHi
I want to create four separate dummy variables at household level:
1. No children between 5 and …
 R-squared in Panel Data (FE/RE models)Dear all,
I am working with panel data, Fixed and Random effects models, and doing my interpretatio… R-squared in Panel Data (FE/RE models)Dear all,
I am working with panel data, Fixed and Random effects models, and doing my interpretatio…
 How to cluster the standard error?Hi,
I am new to Statalist forum. Hope someone can explain to me the issue that I am going through. … How to cluster the standard error?Hi,
I am new to Statalist forum. Hope someone can explain to me the issue that I am going through. …
 creating new variable matching a definitionHello,
I am reposting this, as the previous one had some typos.
I need to count the diffuse nodule… creating new variable matching a definitionHello,
I am reposting this, as the previous one had some typos.
I need to count the diffuse nodule…
Subscribe to:
Post Comments (Atom)
0 Response to Creating polynomial expansion of a variable
Post a Comment