Hello everyone, new to stata and will appreciate any help here.
I have written a loop to run a regression and then below that, I have tried to use the collect commands to export the beta coefficient, p values and confidence intervals into an excel file but I seem to get the following error: Your layout specification does not uniquely match any items. One or more of the following dimensions might help uniquely match items: cmdset, coleq, imd, ethnicity, gender, workingdiagnosis.
(collection default exported to file resulttable3.txt)
My loop is below:
local x "age i.gender i.ethnicity i.workingdiagnosis diseaseduration i.imd"
foreach var of local x {
regress painscore `var'
collect get _r_b _r_p _r_ci
collect dims
collect layout (colname) (result[_r_b _r_p _r_ci])
collect export resulttable3.txt, replace
}
The loop produces the necessary results in the stata results window but nothing seems to be getting exported.
I have written a loop to run a regression and then below that, I have tried to use the collect commands to export the beta coefficient, p values and confidence intervals into an excel file but I seem to get the following error: Your layout specification does not uniquely match any items. One or more of the following dimensions might help uniquely match items: cmdset, coleq, imd, ethnicity, gender, workingdiagnosis.
(collection default exported to file resulttable3.txt)
My loop is below:
local x "age i.gender i.ethnicity i.workingdiagnosis diseaseduration i.imd"
foreach var of local x {
regress painscore `var'
collect get _r_b _r_p _r_ci
collect dims
collect layout (colname) (result[_r_b _r_p _r_ci])
collect export resulttable3.txt, replace
}
The loop produces the necessary results in the stata results window but nothing seems to be getting exported.
Comment