Hello everyone,
I am currently working on a rotating panel, survey data with weights, trying to produce:
This is achieved by applying the following code:
All coding for generating the matrix and the trace work smoothly. Transition matrices are correctly exported through Tabout but Putexcel seems unable to access the excel file for exporting the trace, I get the following error message from STATA:
Thanks everyone
I am currently working on a rotating panel, survey data with weights, trying to produce:
- Transition Matrices for employment status
- Trace of the Transition Matrix.
This is achieved by applying the following code:
Code:
svy: tab lemployment_status employment_status, row se ci deff local i = 1 matrix lagf = J(7,7,.) forvalues row=1/7{ forvalues col=1/7{ matrix m =e(b) matrix lagf[`row',`col'] = m[1,`i'] local i = `i' + 1 } } matrix list m matrix list lagf scalar lagtrace = trace(lagf) scalar list lagtrace tabout lemployment_status employment_status using indicator6_7.xlsx, append svy cells(row se lb ub) format(2c 3c 2c 2c) sebnone pop nwt(WEIGHTVAR) putexcel set "indicator6_7.xls", modify sheet("Mobility Index") putexcel A13 = ("Trace of matrix") putexcel B13 = `lagtrace'
Code:
putexcel A13 = ("Trace of matrix") workbook indicator6_7.xls could not be loaded r(603);