Good morning everyone,
I have been asked to try to visualize a first step regression. Anyway, in order to do this, my datas must be grouped in a certain way with the following command:
sum l_ln_km_IH
gen l_ln_km_IH_0 = ‘r(min)’
forvalues i = 10(10)90 {
egen l_ln_km_IH_‘i’ = pctile(l_ln_km_IH), p(‘i’)
}
gen cat_l_ln_km_IH_temp = 0
local k = 1
forvalues i = 10(10)90 {
replace cat_l_ln_km_IH_temp = ‘k’ if l_ln_km_IH > l_ln_km_IH_‘i’
local k = 1 + ‘k’
}
bysort cat_l_ln_km_IH_temp : egen cat_l_ln_km_IH = mean(l_ln_km_IH)
drop cat_l_ln_km_IH_temp
Anyway, this command does not work. I have problems on the options (i) on pctile and on r(min). I have already tried to not add the ' ', but it does not change anything.
Morever, I don't understand how this command groupes the datas, in other words, I do not understand the logic behind this command.
Can someone help me?
Thank you
Related Posts with First step regression
Missing Values GeneratedHello, I have panel data for 820 companies for 19 years i.e. 15580 observations (820*). I ran the fo…
Manually creating/editing/storing estimates for esttabI am running a series of loops that try out all combinations of Stata's new lasso functions dsregres…
WTP space using effect code and estimated via the command of mixlogitwtpDear Experts, I am doing a DCE study and use the command of mixlogitwtp to estimate WTP space. All …
Question about the command fuzzydidDear all, When I run the codes of fuzzydid help file,but I get an error.I don't know why. Code: …
Panel data Mediation modelDear all, I have a dataset with panel data from 2015-2018 My independent variable is categorical an…
Subscribe to:
Post Comments (Atom)
0 Response to First step regression
Post a Comment