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
Creating 2 dummy variables in StataHi everyone I am back with another question to help me out I have a table output containing lots o…
Running regression while controlling for industry and yearsI'm investigating the influence of patenting (pat_yr -> patents per year) on the returnoninvestem…
Counting yearly cumulative observationsHi all! I am working with the dataset in the attachment. The data in the variable appln_id are Amer…
Odd scalar behaviourDear statalisters, I am running the following code to cut up a very large file (>15g) into small…
merge 1:m using new_id, overwrites id in masterfileDear listers I have two files that i want to merge. File 1 includes: id (string), case_id (string)…
Subscribe to:
Post Comments (Atom)
0 Response to Creating polynomial expansion of a variable
Post a Comment