Dear all,
I´m currently trying to run a dynamic simulation on individuals work biography in a panel dataset.
What it want to do is:
1. in the first step I want to run regressions in the unbalanced panel,
2. then I want to store these coefficients of the explanatory variables
3. use the stored coefficients to calculate transition probabilities.
On example of my code for estimating whether an individual will change their labor force status in t+1 (with trans_lfs is a dummy indicating whether the individual will change its labor force status in t+1):
In the next step I want to run a dynamic simulation for every year using the saved coefficients:
with E_* being the stored coeffiencts.
The problem is, that I have about 10 different models for which I have to store coefficients and later run a dynamic simulation.
So my question is: What is a good why to save and calculate with these coefficients? Saving all the coefficients in ten different dataset seems not really practical and I do not know how I then can use the stored coefficients of each particular regression when needed.
Is there maybe a more elegant/ straightforward way to deal with my problem than the "matsave"-command?
Any help would be appreciated. Thank you very much in advance.
I´m currently trying to run a dynamic simulation on individuals work biography in a panel dataset.
What it want to do is:
1. in the first step I want to run regressions in the unbalanced panel,
2. then I want to store these coefficients of the explanatory variables
3. use the stored coefficients to calculate transition probabilities.
On example of my code for estimating whether an individual will change their labor force status in t+1 (with trans_lfs is a dummy indicating whether the individual will change its labor force status in t+1):
Code:
xtlogit trans_lfs lfs l.lfs c.age c.age2 c.age3 i.edu_highest i.migration i.num_kids c.duration experience earnings birth, re *store coefficients preserve mat mat_lfs= e(b)' capture drop scc install matsave matsave mat_lfs, replace saving p("path") dropall restore
Code:
forval y=1990/2010 { gen lfs_probabilty=. replace lfs probability = lfs*E_lfs + l.lfs*E_laglfs_+ c.age*E_age + c.age2 + E_age2 + ...... if year= `y' & flag==1 }
The problem is, that I have about 10 different models for which I have to store coefficients and later run a dynamic simulation.
So my question is: What is a good why to save and calculate with these coefficients? Saving all the coefficients in ten different dataset seems not really practical and I do not know how I then can use the stored coefficients of each particular regression when needed.
Is there maybe a more elegant/ straightforward way to deal with my problem than the "matsave"-command?
Any help would be appreciated. Thank you very much in advance.
Comment