Hello all! I am a new stata user and am having trouble with coding for a question assigned by my teacher. We are using the comprehensive.dta ( Standardized Data 2002-2005)
The question is as follows:
Use the two-country sample of Pakistan2002 and Germany2005. (Hint: In your “keep” line, you will use “|”.) Create a dummy variable for firms that believe “electricity” is a “major” or “very severe” obstacle (c218b). Tabulate this dummy variable across countries. Report the number of observations in each country and their respective means. Interpret in words what the mean difference is telling you.
I understand that the code starts off as:
and how to generate dummy variable DVc218b:
However, I don't understand how I tab this DV across countries (only one variable!) and the number of observations in each country and their respective means (doesn't the data form a two country sample??)
Any help would be much appreciated. Thank you so much for your help!
Julia
The question is as follows:
Use the two-country sample of Pakistan2002 and Germany2005. (Hint: In your “keep” line, you will use “|”.) Create a dummy variable for firms that believe “electricity” is a “major” or “very severe” obstacle (c218b). Tabulate this dummy variable across countries. Report the number of observations in each country and their respective means. Interpret in words what the mean difference is telling you.
I understand that the code starts off as:
use comprehensive, clear
tab country
keep if country== "Germany2005" | country== "Pakistan2002"
tab country
keep if country== "Germany2005" | country== "Pakistan2002"
gen DVc218b=.
replace DVc218b=1 if c218b==3 | c218b==4
replace DVc218b=0 if c218b==0 | c218b==1 | c218b==2
replace DVc218b=1 if c218b==3 | c218b==4
replace DVc218b=0 if c218b==0 | c218b==1 | c218b==2
Any help would be much appreciated. Thank you so much for your help!
Julia
Comment