Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy...

15
James Skinner ECO4421 Project 1.A) B) 66.32189 years C) 44.83895 years D) 2.342593% hiv Part II 1. A) Lifeexpect=25.78995 + 5.181822log(gdp_pc) + µ (4.021684) (0.5071494) B) The estimated value of B1 is 5.181822, and this means that if you increase gdp_pc by 1%, then it will increase lifeexpect by 0.05181822 years 2. A) Lifeexpect = 50.16 + 1.0705log (gdp_pc) + 0.1941sanitation – 0.193healthexpend - 0.0563percrural (6.922) (0.78) (0.274) (0.2342) (0.0386) . Sample Mean Standard Deviation Maximum Value Minimum Value lifeexpect 66.32189 9.640903 82.24634 44.83895 gdp pc 6333.392 11860.03 74276.72 219.5298 sanitation 61.3787 31.03586 100 8.6 Health expend 6.654835 2.385099 15.43094 2.292848 hiv 2.342593 4.866521 27.1 0.1 Perc rural 50.60528 20.76778 90.908 5.586 Log_gdp_pc 7.821948 1.310572 11.21555 5.391488

Transcript of Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy...

Page 1: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

James Skinner

ECO4421 Project

1.A)

B) 66.32189 years

C) 44.83895 years

D) 2.342593% hiv

Part II

1.

A) Lifeexpect=25.78995 + 5.181822log(gdp_pc) + µ

(4.021684) (0.5071494)

B) The estimated value of B1 is 5.181822, and this means that if you increase gdp_pc by 1%, then it will increase lifeexpect by 0.05181822 years

2.

A) Lifeexpect = 50.16 + 1.0705log (gdp_pc) + 0.1941sanitation – 0.193healthexpend - 0.0563percrural

(6.922) (0.78) (0.274) (0.2342) (0.0386)

.

Sample Mean Standard Deviation

Maximum Value Minimum Value

lifeexpect 66.32189 9.640903 82.24634 44.83895

gdp pc 6333.392 11860.03 74276.72 219.5298

sanitation 61.3787 31.03586 100 8.6

Health expend 6.654835 2.385099 15.43094 2.292848

hiv 2.342593 4.866521 27.1 0.1

Perc rural 50.60528 20.76778 90.908 5.586

Log_gdp_pc 7.821948 1.310572 11.21555 5.391488

Page 2: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

B) If we increase log_gdp_pc by 1 %, then we would expect lifeexpect to have no change holding sanitation, healthexpend, and percrural constant.

C) If we look at two people with the same values of log_gdp_pc, sanitation, and percrural, but one persons healthexpend is one unit higher, then there is no evidence to suggest that the person with the higher healthexpend to have a a different lifeexpect.

D) Lifeexpect = 38.47+2.603log(gdp_pc)+0.132sanitation+0.113healthexpend+0.0105percrural–0.819hiv

(5.472) (0.623) (0.0222) (0.183) (0.0306) (0.095)

.

E) Reject, if you were to give a one unit increase in hiv, you would expect to see a decrease of 0.819 years in lifeexpect, holding log_gdp_pc, sanitation, healthexpend, and percrural constant.

F) H0: They will have the same effect on lifeexpect

HA: They will not have the same effect on lifeexpect

P = 0.91823, there is little evidence to suggest that they will have the same effect on lifeexpect, REJECT

G) 1.940 – 2 * 0.118 healthexpend

H) -1.704

3.

A) F – 2.01 P- 0.0714

Fail to reject the null (homoscedasticity).

Page 3: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

B) Surprisingly there is not a big difference in the data, which suggests homoskedasticity.

4. I would like to add exposure to hazardous materials, access to news, and water cleanliness.

List of commands:

Reg lifeexpect log_gdp_pc

Reg lifeexpect log_gdp_pc sanitation healthexpend percrural

Reg lifeexpect log_gdp_pc sanitation healthexpend percrural hiv

2e: Reg lifeexpect sanitation healthexpend

Test sanitation == healthexpend

Page 4: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

F( 1, 105) = 2.24

Prob > F = 0.1377

2g: gen healthexpendsq = healthexpend^2

Reg lifeexpect healthexpendsq sanitation

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 2, 105) = 92.44

Model | 6343.02733 2 3171.51366 Prob > F = 0.0000

Residual | 3602.30369 105 34.3076542 R-squared = 0.6378

-------------+------------------------------ Adj R-squared = 0.6309

Total | 9945.33102 107 92.9470188 Root MSE = 5.8573

--------------------------------------------------------------------------------

lifeexpect | Coef. Std. Err. t P>|t| [95% Conf. Interval]

---------------+----------------------------------------------------------------

healthexpendsq | -.0089743 .01523 -0.59 0.557 -.0391725 .0212239

sanitation | .248759 .0183103 13.59 0.000 .2124531 .2850649

_cons | 51.50141 1.419309 36.29 0.000 48.68718 54.31563

--------------------------------------------------------------------------------

2h: sum lifeexpect healthexpend healthexpendsq sanitation

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

lifeexpect | 108 66.32189 9.640903 44.83895 82.24634

healthexpend | 108 6.654835 2.385099 2.292848 15.43094

healthexpe~q | 108 49.92285 37.31301 5.257154 238.1139

sanitation | 108 61.3787 31.03586 8.6 100

Page 5: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

. reg lifeexpect log_gdp_pc

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 1, 106) = 104.40

Model | 4934.80789 1 4934.80789 Prob > F = 0.0000

Residual | 5010.52313 106 47.2690861 R-squared = 0.4962

-------------+------------------------------ Adj R-squared = 0.4914

Total | 9945.33102 107 92.9470188 Root MSE = 6.8753

------------------------------------------------------------------------------

lifeexpect | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

log_gdp_pc | 5.181822 .5071494 10.22 0.000 4.176349 6.187295

_cons | 25.78995 4.021684 6.41 0.000 17.81657 33.76333

------------------------------------------------------------------------------

. reg lifeexpect log_gdp_pc sanitation healthexpend percrural

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 4, 103) = 51.42

Model | 6626.95565 4 1656.73891 Prob > F = 0.0000

Residual | 3318.37537 103 32.2172366 R-squared = 0.6663

-------------+------------------------------ Adj R-squared = 0.6534

Total | 9945.33102 107 92.9470188 Root MSE = 5.676

Page 6: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

------------------------------------------------------------------------------

lifeexpect | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

log_gdp_pc | 1.070499 .7794457 1.37 0.173 -.4753476 2.616346

sanitation | .1940526 .0274341 7.07 0.000 .1396436 .2484617

healthexpend | -.1908502 .2341873 -0.81 0.417 -.6553056 .2736051

percrural | -.0562863 .0386082 -1.46 0.148 -.1328564 .0202839

_cons | 50.15626 6.922334 7.25 0.000 36.42744 63.88508

------------------------------------------------------------------------------

. reg lifeexpect log_gdp_pc sanitation healthexpend percrural hiv

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 5, 102) = 84.91

Model | 8018.8276 5 1603.76552 Prob > F = 0.0000

Residual | 1926.50342 102 18.8872884 R-squared = 0.8063

-------------+------------------------------ Adj R-squared = 0.7968

Total | 9945.33102 107 92.9470188 Root MSE = 4.346

------------------------------------------------------------------------------

lifeexpect | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

log_gdp_pc | 2.603237 .622933 4.18 0.000 1.367652 3.838821

sanitation | .1323278 .022202 5.96 0.000 .0882903 .1763653

healthexpend | .1131425 .1827731 0.62 0.537 -.249387 .4756721

percrural | .0104922 .0305674 0.34 0.732 -.0501382 .0711225

hiv | -.8191408 .0954209 -8.58 0.000 -1.008408 -.6298738

Page 7: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

_cons | 38.47241 5.472173 7.03 0.000 27.61838 49.32644

------------------------------------------------------------------------------

. esize unpaired sanitation == healthexpend, all unequal

Effect size based on mean comparison, unequal variances

Number of obs = 216

---------------------------------------------------------

Effect Size | Estimate [95% Conf. Interval]

--------------------+------------------------------------

Cohen's d | 2.486276 2.058973 2.908736

Hedges's g | 2.477551 2.051747 2.898528

Glass's Delta 1 | 1.763247 1.404751 2.116957

Glass's Delta 2 | 22.94407 19.86026 26.02216

Point-Biserial r | .8689633 .823968 .8991282

---------------------------------------------------------

Satterthwaite's degrees of freedom = 108.2638

. esize unpaired sanitation == healthexpend, all unequal

Effect size based on mean comparison, unequal variances

Number of obs = 216

---------------------------------------------------------

Effect Size | Estimate [95% Conf. Interval]

--------------------+------------------------------------

Cohen's d | 2.486276 2.058973 2.908736

Page 8: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

Hedges's g | 2.477551 2.051747 2.898528

Glass's Delta 1 | 1.763247 1.404751 2.116957

Glass's Delta 2 | 22.94407 19.86026 26.02216

Point-Biserial r | .8689633 .823968 .8991282

---------------------------------------------------------

Satterthwaite's degrees of freedom = 108.2638

. mvtest covariances sanitation healthexpend, by(lifeexpect)

insufficient observations

r(2001);

. test (_b[sanitation] = _b[healthexpend])

( 1) sanitation - healthexpend = 0

F( 1, 102) = 0.01

Prob > F = 0.9182

. reg lifeexpect hiv

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 1, 106) = 46.27

Model | 3021.84218 1 3021.84218 Prob > F = 0.0000

Residual | 6923.48883 106 65.3159324 R-squared = 0.3038

-------------+------------------------------ Adj R-squared = 0.2973

Total | 9945.33102 107 92.9470188 Root MSE = 8.0818

------------------------------------------------------------------------------

Page 9: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

lifeexpect | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

hiv | -1.092007 .1605458 -6.80 0.000 -1.410305 -.7737092

_cons | 68.88002 .8638423 79.74 0.000 67.16737 70.59267

------------------------------------------------------------------------------

. reg lifeexpect log_gdp_pc hiv percrural

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 3, 104) = 96.67

Model | 7320.25067 3 2440.08356 Prob > F = 0.0000

Residual | 2625.08035 104 25.2411572 R-squared = 0.7360

-------------+------------------------------ Adj R-squared = 0.7284

Total | 9945.33102 107 92.9470188 Root MSE = 5.0241

------------------------------------------------------------------------------

lifeexpect | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

log_gdp_pc | 5.050173 .5397628 9.36 0.000 3.979803 6.120543

hiv | -.984542 .1028086 -9.58 0.000 -1.188415 -.7806687

percrural | .0175585 .0347659 0.51 0.615 -.0513837 .0865007

_cons | 28.23752 5.619588 5.02 0.000 17.09367 39.38138

------------------------------------------------------------------------------

. reg lifeexpect sanitation healthexpend

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 2, 105) = 92.28

Page 10: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

Model | 6338.86394 2 3169.43197 Prob > F = 0.0000

Residual | 3606.46708 105 34.3473055 R-squared = 0.6374

-------------+------------------------------ Adj R-squared = 0.6305

Total | 9945.33102 107 92.9470188 Root MSE = 5.8607

------------------------------------------------------------------------------

lifeexpect | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

sanitation | .2489521 .0184029 13.53 0.000 .2124625 .2854417

healthexpend | -.1137403 .2394661 -0.47 0.636 -.5885572 .3610767

_cons | 51.79846 1.917951 27.01 0.000 47.99552 55.6014

------------------------------------------------------------------------------

. test sanitation == healthexpend

( 1) sanitation - healthexpend = 0

F( 1, 105) = 2.24

Prob > F = 0.1377

. gen health_expend^2

^ invalid name

r(198);

. gen healthexpendsq

=exp required

r(100);

Page 11: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

. gen healthexpendsq2

=exp required

r(100);

. gen healthexpend2sq

=exp required

r(100);

. gen healthexpend^2

healthexpend already defined

r(110);

. gen healthexpendsq^2

^ invalid name

r(198);

. gen healthexpend^2sq

healthexpend already defined

r(110);

. gen healthexpend^sq

healthexpend already defined

r(110);

. reg healthexpendsq sanitation

variable healthexpendsq not found

r(111);

Page 12: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

. gen healthexpendsq

=exp required

r(100);

. gen healthexpend=2

healthexpend already defined

r(110);

. gen healthexpendsq=2

. reg healthexpendsq sanitation

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 1, 106) = .

Model | 0 1 0 Prob > F = .

Residual | 0 106 0 R-squared = .

-------------+------------------------------ Adj R-squared = .

Total | 0 107 0 Root MSE = 0

------------------------------------------------------------------------------

healthexpe~q | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

sanitation | 0 (omitted)

_cons | 2 . . . . .

------------------------------------------------------------------------------

. drop healthexpendsq

Page 13: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

. reg healthexpend^2

^ invalid name

r(198);

. reg healthexpendsq

variable healthexpendsq not found

r(111);

. gen healthexpendsq = healthexpend^sq

sq not found

r(111);

. gen healthexpendsq = healthexpend^2

. reg healthexpendsq sanitation

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 1, 106) = 0.76

Model | 1063.2887 1 1063.2887 Prob > F = 0.3847

Residual | 147908.624 106 1395.36438 R-squared = 0.0071

-------------+------------------------------ Adj R-squared = -0.0022

Total | 148971.913 107 1392.26087 Root MSE = 37.355

------------------------------------------------------------------------------

healthexpe~q | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

sanitation | .1015711 .1163558 0.87 0.385 -.1291157 .3322578

_cons | 43.68855 7.995307 5.46 0.000 27.83708 59.54002

Page 14: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

------------------------------------------------------------------------------

. reg lifeexpect healthexpendsq sanitation

Source | SS df MS Number of obs = 108

-------------+------------------------------ F( 2, 105) = 92.44

Model | 6343.02733 2 3171.51366 Prob > F = 0.0000

Residual | 3602.30369 105 34.3076542 R-squared = 0.6378

-------------+------------------------------ Adj R-squared = 0.6309

Total | 9945.33102 107 92.9470188 Root MSE = 5.8573

--------------------------------------------------------------------------------

lifeexpect | Coef. Std. Err. t P>|t| [95% Conf. Interval]

---------------+----------------------------------------------------------------

healthexpendsq | -.0089743 .01523 -0.59 0.557 -.0391725 .0212239

sanitation | .248759 .0183103 13.59 0.000 .2124531 .2850649

_cons | 51.50141 1.419309 36.29 0.000 48.68718 54.31563

--------------------------------------------------------------------------------

. var lifeexpect healthexpend healthexpendsq sanitation

time variable not set, use -tsset varname ...-

r(111);

. sum lifeexpect healthexpend healthexpendsq sanitation

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

lifeexpect | 108 66.32189 9.640903 44.83895 82.24634

Page 15: Using STATA and Variables From the World Data Bank to Perform Regression Analysis on Life Expectancy Factors

healthexpend | 108 6.654835 2.385099 2.292848 15.43094

healthexpe~q | 108 49.92285 37.31301 5.257154 238.1139

sanitation | 108 61.3787 31.03586 8.6 100

.