I have the code below. I want to export the result from the code below to excel and also want to add standard deviations for the two groups SCTP and NonSCTP.
Code:
local vars "HAZ WAZ WHZ Female melevel region twins children_U5 water_source helevel year district AdjHAZ newcage newcage_6 newcage_11 newreligion newwealthsco newhhsex newwage newhhweight newchild_weight agediff"
matrix means = J(23, 3, -99)
matrix colnames means = NonSCTP SCTP t-value
matrix rownames means = `vars'
local irow = 0
qui {
foreach var of varlist `vars' {
local ++irow
sum `var' if SCTP == 0
matrix means[`irow',1] = r(mean)
sum `var' if SCTP == 1
matrix means[`irow',2] = r(mean)
ttest `var', by(SCTP)
matrix means[`irow',3] = r(t)
}
}
matrix list means, format(%15.4f)
Related Posts with Desscriptive Statistics and Matrices
xtdcce2 not allowing me to run the HaumanDear members, I am a user of Stata/15.1 SE. I am employing the Panel ARDL Technique using XTDCCE2 …
Panel Data & Pearson's Correlation MatrixHi, I am using log variable. Should I use the logged variable for my Pearson's matrix or regular va…
rangestat errorHi, I am trying to do a regression using -rangestat-, but it gives an error saying "no result for al…
-lnoffset- and -exposure- options from -glm-Dear All, Good afternoon. I do hope this one finds you well. While challenging myself with the examp…
xlabel in bar chart. I want to make the negative x-axis values in the bar chart (attached figure) to positve values, eg …
Subscribe to:
Post Comments (Atom)
0 Response to Desscriptive Statistics and Matrices
Post a Comment