I want to output to excel to organize my mixlogit outputs. The code I have works well to write mixed logit to excel, but I do not know how to command Stata to insert a blank row in the middle of the 'matlist results' output without overwriting the results themselves. (I need to insert the blank row so that I can take the negative sum to get the third attribute: this is effects coded data). Any ideas on how to do this? My code below works well to export to stata, but not to add in the insert rows within the results:
** Exporting results **
mixlogit choice, group(resptask) id(respid) rand($varse) nrep(200)
matlist r(table)
matrix results = r(table)
matrix results = results[1..6,1...]'
matlist results
putexcel set RegressionDCEDMD.xlsx, sheet(Mixlogit effects) replace
putexcel A12 = matrix(results), names nformat(number_d2) hcenter
putexcel A1=(e(title)) ///
E1 = "Results last updated" G1 = "`c(current_date)'" ///
A2=(e(cmdline)) ///
A4=("Obs") B4=(e(N)) ///
A5= ("Clusters") B5=(e(N_clust)) ///
A6=("Wald chi2(df)") B6=(e(chi2)) ///
A7= ("DF") B7=(e(df_m)) ///
A8=("Prob>chi2") B8=(e(p)) ///
A9 =("Psuedo R2") B9= (e(r2_p)) ///
A10 = ("Log psuedolikelihood") B10= (e(ll))
vce
return list
matrix list r(V)
putexcel A37 = ("Covariance matrix of coefficients") ///
C36 = matrix(r(V))
Thank you!!
** Exporting results **
mixlogit choice, group(resptask) id(respid) rand($varse) nrep(200)
matlist r(table)
matrix results = r(table)
matrix results = results[1..6,1...]'
matlist results
putexcel set RegressionDCEDMD.xlsx, sheet(Mixlogit effects) replace
putexcel A12 = matrix(results), names nformat(number_d2) hcenter
putexcel A1=(e(title)) ///
E1 = "Results last updated" G1 = "`c(current_date)'" ///
A2=(e(cmdline)) ///
A4=("Obs") B4=(e(N)) ///
A5= ("Clusters") B5=(e(N_clust)) ///
A6=("Wald chi2(df)") B6=(e(chi2)) ///
A7= ("DF") B7=(e(df_m)) ///
A8=("Prob>chi2") B8=(e(p)) ///
A9 =("Psuedo R2") B9= (e(r2_p)) ///
A10 = ("Log psuedolikelihood") B10= (e(ll))
vce
return list
matrix list r(V)
putexcel A37 = ("Covariance matrix of coefficients") ///
C36 = matrix(r(V))
Thank you!!
Comment