Third Internal - Q&A
Third Internal - Q&A
(Sem-II); 2024]
Paper: C-9 (Computer Application)
Full Marks: 10 Time: 20 Minutes Date: 08.08.2024
Read the data description carefully and answer any ONE of the following questions
File name: survey.dta Folder address: "C:\Desktop\Exam\"
Variable Description Remarks
hhsl Household’s unique serial number Values 1 to 1000
location Rural/Urban category codes Values 1 and 2
agri_k Household’s agricultural land (in Katha unit) May have missing values
agri_b Household’s agricultural land (in Bigha unit; 1 bigha=20 katha) May have missing values
light Codes for household’s main source of light Values 1, 2 or 3
fuel Codes for household’s main source of cooking fuel Values 1, 2, 3 or 4
age1 Age of the member1 (in completed years) Integer values
sex1 Gender code for member1 Values 1 or 2
edu1 Educational status of memer1 (number of years of study) Integer values
epm1 Earning per month by member1 (Rs) May have missing values
age2 Age of the member2 (in completed years) Integer values
sex2 Gender code for member2 Values 1 or 2
edu2 Educational status of memer2 (number of years of study) Integer values
epm2 Earning per month by member2 (Rs) May have missing values
age3 Age of the member3 (in completed years) May have missing values
sex3 Gender code for member3 May have missing values
edu3 Educational status of memer3 (number of years of study) May have missing values
epm3 Earning per month by member3 (Rs) May have missing values
age4 Age of the member4 (in completed years) May have missing values
sex4 Gender code for member4 May have missing values
edu4 Educational status of memer4 (number of years of study) May have missing values
epm4 Earning per month by member4 (Rs) May have missing values
age5 Age of the member5 (in completed years) May have missing values
sex5 Gender code for member5 May have missing values
edu5 Educational status of memer5 (number of years of study) May have missing values
epm5 Earning per month by member5 (Rs) May have missing values
Q1. Assume that you have just opened Stata software. Consider member1 in every household is its head.
Write Stata commands sequentially to run a linear regression to estimate the model specified below:
HH’s total Earning per month = f (HH size, location, total land, head’s age, head’s gender)
OR
Q2. Assume that you have just opened Stata software. Write Stata commands sequentially to run a linear
regression to estimate the model specified below:
Whether a member (of age>18 years) is earning any money = f (age, sex and education of the member)
Note that the dependent variable is a binary variable (0,1) that you have to create.
/* Answer to Q1 */
cd "C:\Desktop\Exam\”
use “survey.dta”
mvencode agri_b agri_k epm*, mv(0)
gen fsise=0
replace fsize=fsize+1 if age1 !=.
replace fsize=fsize+1 if age2 !=.
replace fsize=fsize+1 if age3 !=.
replace fsize=fsize+1 if age4 !=.
replace fsize=fsize+1 if age5 !=.
/* Answer to Q2 */
cd "C:\Desktop\Exam\”
use “survey.dta”
keep hhsl age* sex* edu* epm*
reshape long age sex edu epm, i(hhsl) j(memsl)
gen earning=.
replace earning=0 if age>18 & epm==.
replace earning=1 if age>18 & epm!=.