EC252 Assignment

更新时间:2024-05-30 16:06:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Question 1

I issued the command sum health private inc docvis to collect the average, the standard deviation, the minimum value, and the maximum value in the data.

Variable Obs Mean Std. Dev. Min Max health 1116 71.41414 19.34664 4.161454 99.97827 private 1116 .1317204 .3383382 0 1 inc 1116 22746.46 9495.517 2462 61538 docvis 1116 2.882616 4.508251 0 30

Therefore, the average, the standard deviation, the minimum value, and the maximum value of health are respectively 71.41414, 19.34664, 4.161454, and 99.97827.

The average, the standard deviation, the minimum value, and the maximum value of private are respectively 0.1317204, 0.3383382, 0 and 1.

The average, the standard deviation, the minimum value, and the maximum value of inc are respectively 22746.46, 9495.517, 2462 and 61538.

The average, the standard deviation, the minimum value, and the maximum value of inc are respectively 2.882616, 4.508251, 0 and 30.

In addition, there are 1116 observations in the data set.

Question 2

(a) I issued the command: gen loginc=ln(inc) label var loginc \

for generating a new variable loginc as the (natural) logarithm of inc and label this variable.

(b) I issued the command:

lab var private \

for Labelling the indicator variable for private health insurance.

(c) I issued the command:

label define private 0 \ lab val private private tab private

for labelling each value of the variable private appropriately.

(d) I issued the command: tab private

private health insurance Freq. Percent Cum. otherwise 969 86.83 86.83private health insurance 147 13.17 100.00 Total 1,116 100.00

sum health if age>=40 & age <=49 & private==1

Variable Obs Mean Std. Dev. Min Max health 50 75.72246 21.53046 10.37178 99.97827

Therefore, 86.63% of individuals have private health insurance.

The average level of health status is 75.72246 for individuals with private health insurance who are at least 40 and at most 49 years old. (e) I issued the command:

gen incgroup=.

replace incgroup=1 if inc<= 10000

replace incgroup=2 if inc>= 10000 & inc <= 19999 replace incgroup=3 if inc>= 20000 & inc <= 29999 replace incgroup=4 if inc>= 30000 & inc <= 39999 replace incgroup=5 if inc>= 40000 & inc <= 49999

replace incgroup=6 if inc>= 50000 & inc <= 59999 tab incgroup

sum incgroup if inc>= 40000 & inc <= 49999

incgroup Freq. Percent Cum. 1 55 4.95 4.95 2 425 38.22 43.17 3 427 38.40 81.56 4 149 13.40 94.96 5 39 3.51 98.47 6 17 1.53 100.00 Total 1,112 100.00 Variable Obs Mean Std. Dev. Min Max incgroup 39 5 0 5 5Therefore, there are 17 households in the income group 40,000-49,999 EUR.

Question 3

I issued the command: tab female

label define female_lable 0 \lab val female female_lable1 tab female

histogram health if female== 1, name(hist1, replace) histogram health if female== 0, name(hist2, replace)

Density.0050.01.015.02.025204060health80100

Above picture is the histogram of health status for females.

.03Density.010.0202040health6080100 Above picture is the histogram of health for males.

Question 4

I issued the command: correlate health educ

health educ health 1.0000 educ 0.0783 1.0000As you can see, there is not a strong relationship between two variables.

Question 5

(a)I issued the command: regress health age female educ

Source SS df MS Number of obs = 1116 F( 3, 1112) = 13.58 Model 14752.3691 3 4917.45638 Prob > F = 0.0000 Residual 402583.827 1112 362.035816 R-squared = 0.0353 Adj R-squared = 0.0327 Total 417336.196 1115 374.292553 Root MSE = 19.027 health Coef. Std. Err. t P>|t| [95% Conf. Interval] age -.3250652 .0561682 -5.79 0.000 -.4352728 -.2148576 female -.9328762 1.209883 -0.77 0.441 -3.306788 1.441035 educ .423733 .2239645 1.89 0.059 -.0157076 .8631735 _cons 80.50746 3.86767 20.82 0.000 72.91871 88.09622

(b) I issued the command: regress health age female educ if educ>=8 & educ <=11

Source SS df MS Number of obs = 661 F( 3, 657) = 6.00 Model 6316.37179 3 2105.45726 Prob > F = 0.0005 Residual 230695.337 657 351.134454 R-squared = 0.0267 Adj R-squared = 0.0222 Total 237011.708 660 359.108649 Root MSE = 18.739 health Coef. Std. Err. t P>|t| [95% Conf. Interval] age -.3045003 .0749 -4.07 0.000 -.4515726 -.157428 female -1.362423 1.59443 -0.85 0.393 -4.493216 1.76837 educ .3673577 1.082656 0.34 0.734 -1.758525 2.49324 _cons 79.44583 12.13511 6.55 0.000 55.61756 103.2741

(c) I issued the command: regress health age female educ if educ>=12 & educ <=15

Source SS df MS Number of obs = 169 F( 3, 165) = 3.28 Model 3995.078 3 1331.69267 Prob > F = 0.0223 Residual 66894.7695 165 405.422845 R-squared = 0.0564 Adj R-squared = 0.0392 Total 70889.8475 168 421.963378 Root MSE = 20.135 health Coef. Std. Err. t P>|t| [95% Conf. Interval] age -.423569 .1411224 -3.00 0.003 -.7022075 -.1449305 female 1.139752 3.258698 0.35 0.727 -5.29437 7.573874 educ .149646 1.274803 0.12 0.907 -2.367383 2.666675 _cons 87.32038 18.29475 4.77 0.000 51.19838 123.4424

Question 6

(a) I issued the command: gen agem2= age^2 gen agem3= age^3 label var agem2 \label var agem3 \

regress health age agem2 agem3 female educ

Source SS df MS Number of obs = 1116 F( 5, 1110) = 8.96 Model 16194.2493 5 3238.84985 Prob > F = 0.0000 Residual 401141.947 1110 361.389141 R-squared = 0.0388 Adj R-squared = 0.0345 Total 417336.196 1115 374.292553 Root MSE = 19.01 health Coef. Std. Err. t P>|t| [95% Conf. Interval] age .485484 3.166313 0.15 0.878 -5.727149 6.698117 agem2 -.0075369 .0755587 -0.10 0.921 -.1557908 .140717 agem3 -.0000296 .0005829 -0.05 0.960 -.0011732 .0011141 female -.9160576 1.208833 -0.76 0.449 -3.287912 1.455797 educ .4262633 .226685 1.88 0.060 -.018516 .8710427 _cons 63.0898 42.42545 1.49 0.137 -20.15332 146.3329

Question 7

I issued the command: regress health age if educ==11, robust

Question 8

I issued the command:

egen avehealth=mean(health), by(incgroup) graph twoway bar avehealth incgroup

90avehealth70758085123incgroup456

本文来源:https://www.bwwdw.com/article/bb96.html

Top