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
Reducing estimated residual of our modelGoodmorning! Can someone explain me how to reduce the estimated residual of our model? …
Combining multiple loops to write summary statistics to excel efficiently.Hi, I'm trying to produce summary statistics of a variable efficiently as it will have to be done n…
Tag time-invariant & time-varying variables in panelHi Statalist This probably has a very simple solution but I am struggling to figure it out. For a …
Many points are overlapped, how to better plot the scatter? Code: * Example generated by -dataex-. To install: ssc install dataex clear input float a double b…
Factor analysis or similar data reduction technique for variables with different response options (binary and multiple response options)I am trying to create a variable that assess the construct of "knowledge" using participant's respon…
Subscribe to:
Post Comments (Atom)
0 Response to First step regression
Post a Comment