Hi,
So I created a dummy variable by the following code:
gen YearGroup = 0
replace YearGroup = 1 if year>=2011
label define YearGroup_label 0 "Max MTR 2003-2010" 1 "Max MTR 2011-2018"
label values YearGroup YearGroup_label
Now I am trying to take the mean of another variable (which is MIT) by Region_Name and YearGroup but I get the error varlist not allowed
MIT
30
60.06
20
40
28
I used the following command:
egen mean_MIT_yearGroup = mean(MIT) by (Region_Name YearGroup)
but it gives me error. Can someone please help? Thank you.
Related Posts with Dummy Variable
Creating categorical summary values for cities annually, weighted/unweightedHi guys. New to running Stata for large groups. I'm working with IPUMs American Community Survey Da…
Merge mulitple .csv filesI am using Stata 16.1 MP to merge six .csv files on neonatal, infant, and child mortality. I would l…
Finding and plotting the trend of the weighted average of variable Code: * Example generated by -dataex-. To install: ssc install dataex clear input double total_asse…
xtivreg2 export first and second stage resultsAs the description of xtivreg2 says, it is the wrapper of ivreg2. But the "savefirst“ option of ivre…
Remove part of a Text in observationHi guys, Below is a sample of my data. I would like to remove the "-TOT RETURN IND" in all the obser…
Subscribe to:
Post Comments (Atom)
0 Response to Dummy Variable
Post a Comment