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
How to know the sample of countries taken in an analysis!Hi ! This may sound like a silly question. I am working on a panel data with 140 countries. However…
🐛 Suspected bug in frames handling of dataDear All, I think I have encountered a bug in Stata where using a temporary frame may result in dat…
Selecting variables in a dataset from observations within another datasetHello, Hope there is someone who could help me to solve this... I have a dataset with monthly retu…
Pre-Post analysis: How to compare frequencies for each category across rounds?Hi all, I have a panel data of the following form: Code: * Example generated by -dataex-. To inst…
convergence with SEMDear all, I use STATA 15.1 to build a full model with SEM. In the final process, STATA shows me th…
Subscribe to:
Post Comments (Atom)
0 Response to First step regression
Post a Comment