Hello,
I have a very large dataset on which I am trying to perform specific analyses but am coming across obstacles due to my lack of Stata inexpertise. The dataset provides details about the gender, age, level of education and other characteristics of the respondents. I am trying to calculate the percentage of never-married urban women aged 20-24 with no ownership of a personal mobile phone and then sort this by various other characteristics, e.g: never-married urban women aged 20-24 who don't own a mobile phone by level of education, by the province in which they reside..etc. Similar tasks would be the percentage of never-married urban women aged 20-24 with the ownership of only a smartphone, the percentage of never-married urban women aged 20-24 with access to the internet. I would like to then sort these by the other characteristics as I mentioned.
I was trying to calculate this using the following code but didn't succeed:
gen mobile=0 if sb1q7==0 & sb1q4==1 & region==1 (region==1 is urban residence)
replace mobile=1 if sb1q7=0 & sb1q4==1 & region==1 & sc2q05==3
The process already failed here but if it had succeeded, I would have then gone to do something like this:
gen mobilepercent=mobile*100
format *_100 %6.1f
tab province if sc1q05==13 summarize(mobilepercent) means noobs (sc1q05==13 is education upto highschool graduation)
I don't know how to fit the age range 20-24 into this.
The dataset is very large, it has over 800,000+ observations, the default dataex only outputs 100 observations of each variable, so the entire data is not being described but nonetheless people can get an idea from these:
age [age of respondents[
sb1q7 [marital status of respondent]
sb1q4 [gender of respondent]
sc2q05 [mobile ownership status of respondents]
DE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte sc2q05
1
1
3
3
3
3
3
3
1
3
2
3
3
3
2
3
3
3
2
2
3
1
3
3
3
1
3
3
1
1
3
1
3
2
1
2
1
3
3
3
2
2
3
1
3
3
3
2
3
3
2
1
1
3
3
3
3
3
3
1
3
3
3
3
3
1
2
1
3
3
3
1
3
1
1
2
3
1
3
3
1
3
3
3
1
3
3
3
3
1
3
3
3
1
2
3
3
3
3
3
end
label values sc2q05 sc2q05
label def sc2q05 1 "mobile phone", modify
label def sc2q05 2 "smart phone", modify
label def sc2q05 3 "none of above", modify
[/CODE]
I have a very large dataset on which I am trying to perform specific analyses but am coming across obstacles due to my lack of Stata inexpertise. The dataset provides details about the gender, age, level of education and other characteristics of the respondents. I am trying to calculate the percentage of never-married urban women aged 20-24 with no ownership of a personal mobile phone and then sort this by various other characteristics, e.g: never-married urban women aged 20-24 who don't own a mobile phone by level of education, by the province in which they reside..etc. Similar tasks would be the percentage of never-married urban women aged 20-24 with the ownership of only a smartphone, the percentage of never-married urban women aged 20-24 with access to the internet. I would like to then sort these by the other characteristics as I mentioned.
I was trying to calculate this using the following code but didn't succeed:
gen mobile=0 if sb1q7==0 & sb1q4==1 & region==1 (region==1 is urban residence)
replace mobile=1 if sb1q7=0 & sb1q4==1 & region==1 & sc2q05==3
The process already failed here but if it had succeeded, I would have then gone to do something like this:
gen mobilepercent=mobile*100
format *_100 %6.1f
tab province if sc1q05==13 summarize(mobilepercent) means noobs (sc1q05==13 is education upto highschool graduation)
I don't know how to fit the age range 20-24 into this.
The dataset is very large, it has over 800,000+ observations, the default dataex only outputs 100 observations of each variable, so the entire data is not being described but nonetheless people can get an idea from these:
age [age of respondents[
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte age 58 46 18 13 12 10 8 6 64 61 34 13 9 6 30 7 4 98 35 35 0 56 44 50 42 16 5 2 67 31 10 15 13 65 57 33 24 2 0 50 26 23 21 29 6 4 2 16 82 44 47 41 17 15 14 8 7 6 5 37 13 12 7 3 1 37 26 48 15 8 5 30 30 47 28 24 20 28 65 30 39 30 2 0 34 10 8 7 5 59 50 20 18 35 33 10 8 6 54 40 end
sb1q7 [marital status of respondent]
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte sb1q7 2 2 1 1 1 1 1 1 2 2 2 1 1 1 2 1 1 3 2 2 1 2 2 2 2 1 1 1 2 3 1 1 1 2 2 2 2 1 1 2 1 1 1 3 1 1 1 1 3 1 2 2 1 1 1 1 1 1 1 2 1 1 1 1 1 2 2 2 1 1 1 2 2 3 1 1 1 1 3 1 2 2 1 1 2 1 1 1 1 2 2 1 1 2 2 1 1 1 2 2 end label values sb1q7 sb1q7 label def sb1q7 1 "unmarried / never married", modify label def sb1q7 2 "currently married", modify label def sb1q7 3 "widow / widower", modify
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte sb1q4 1 2 2 2 2 1 1 1 1 2 2 2 2 1 2 1 1 2 1 2 2 1 2 1 2 1 1 1 2 2 1 2 2 1 2 1 2 1 1 2 1 1 2 2 1 1 1 1 2 2 1 2 1 2 2 2 1 1 2 2 2 2 2 2 2 1 2 2 2 2 1 1 2 2 1 1 2 1 2 2 1 2 2 1 2 1 1 1 1 1 2 2 2 1 2 1 2 1 1 2 end label values sb1q4 sb1q4 label def sb1q4 1 "male", modify label def sb1q4 2 "female", modify
DE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte sc2q05
1
1
3
3
3
3
3
3
1
3
2
3
3
3
2
3
3
3
2
2
3
1
3
3
3
1
3
3
1
1
3
1
3
2
1
2
1
3
3
3
2
2
3
1
3
3
3
2
3
3
2
1
1
3
3
3
3
3
3
1
3
3
3
3
3
1
2
1
3
3
3
1
3
1
1
2
3
1
3
3
1
3
3
3
1
3
3
3
3
1
3
3
3
1
2
3
3
3
3
3
end
label values sc2q05 sc2q05
label def sc2q05 1 "mobile phone", modify
label def sc2q05 2 "smart phone", modify
label def sc2q05 3 "none of above", modify
[/CODE]
Comment