Hello !
so i hvae trying this code i found in a tutorial to create a table similar to the one joind here and i get : 'Invalid type of entry in cells option, or you may
have forgotten to turn on the sum or svy option'
i dont know where should i turn on these options or whether the code doesnt actualy work for this goal
the code :
************************************************** ***************************************
use "data path", clear
generate dummy = 1
tokenize "classize c_size tipuach "
local counter = 0
local filemethod = "replace"
local heading = "h1(nil) h2(nil) h3(|Mean |SD | p10 | p25 | p50| p75 )"
foreach v of varlist classize c_size tipuach {
if `counter' > 0 {
local filemethod = "append"
local heading = "h1(nil) h2(nil) h3(nil)"
}
label define dummy 1 "`1'", modify
label val dummy dummy
tabout dummy using example.txt, ///
`filemethod' c(mean `v' SD `v' ///f(1c 1c 1c 1c 1c 0) sum `heading' ///
lines(none) ptotal(none)
mac shift
local counter = `counter' + 1
}
************************************************** ***************************************
the kind of table im trying to get : ( please do share if you have a better code for this type pf tables, thank you)
Array
Related Posts with Descriptive stats
Creating Dummy variable with a condition based on the previous 3 yearsDear Stata members, I have a question please , I want to create a new dummy variable =1 if a firm h…
Labeling a density curveSorry, I'm too stupid to figure this out myself. I want to make a density curve, so I'll do this: …
KHB Method: Obtaining P Value for Mediated Effects I am using the KHB method on STATA to analyze the mediated impacts of religious identity and relig…
Fixed effects in first-differenced modelHi! I have a first-differenced model, where my units are municipalities. I am adding regional fixed…
Replace string value with a missing value (dot)I have a dataset with a variable "sex". I would like to know how can I replace a string value "missi…
Subscribe to:
Post Comments (Atom)
0 Response to Descriptive stats
Post a Comment