Hello,
I am running a multilevel analysis and I am adjusting for confounders. I want to export my results on excel.
However, I only want to export the beta coefficients and 95%CI of my main predictor and not of the other covariates.
I am using putexcel command and matrix list r(table) but I am entering manually the column number from the matrix. Is there a way to automate the process.
This is the codes I am using:
"putexcel set "Multiple regression.xlsx", sheet(Subtype) modify
melogit Outcome age i.gender i.Predictor [pw= ponderation] || sclid: , pweight(weight_school)
ereturn list
matrix list r(table)
local beta=string(r(table)[1,5], "%9.4f")
local ll=string(r(table)[5,5], "%9.4f")
local ul=string(r(table)[6,5], "%9.4f")
local all=`" `b' [ `ll' - `ul' ] "'
putexcel B4 =`"`all'"'
"
Instead of manually write the column number from the matrix table (i.e., 5), is there a code to automate the process?
Thank you !
I am running a multilevel analysis and I am adjusting for confounders. I want to export my results on excel.
However, I only want to export the beta coefficients and 95%CI of my main predictor and not of the other covariates.
I am using putexcel command and matrix list r(table) but I am entering manually the column number from the matrix. Is there a way to automate the process.
This is the codes I am using:
"putexcel set "Multiple regression.xlsx", sheet(Subtype) modify
melogit Outcome age i.gender i.Predictor [pw= ponderation] || sclid: , pweight(weight_school)
ereturn list
matrix list r(table)
local beta=string(r(table)[1,5], "%9.4f")
local ll=string(r(table)[5,5], "%9.4f")
local ul=string(r(table)[6,5], "%9.4f")
local all=`" `b' [ `ll' - `ul' ] "'
putexcel B4 =`"`all'"'
"
Instead of manually write the column number from the matrix table (i.e., 5), is there a code to automate the process?
Thank you !
Comment