Anda di halaman 1dari 8

___ ____ ____ ____ __

__(R)
/__

____/

___

_/
___/

/___/

/___

/
Statistics/Data Analysis

___ ____ ____ ____ ____ (R)


/__
/ ____/ / ____/
___/ / /___/ / /___/ 12.0
Statistics/Data Analysis

Copyright 1985-2011 StataCorp LP


StataCorp
4905 Lakeway Drive
College Station, Texas 77845 USA
800-STATA-PC
http://www.stata

.com
979-696-4600
stata@stata.com
979-696-4601 (fax)
Single-user Stata license expires 18 Mar 2014:
Serial number: 301309222409
Licensed to: Martin C. Aragoneses T.
Notes:
1 . use "/Users/Martin/Downloads/birthweight_sample.dta"
2 . save "/Users/Martin/Desktop/birthweight_sample_MAT.dta"
file /Users/Martin/Desktop/birthweight_sample_MAT.dta saved
3 . save "/Users/Martin/Desktop/birthweight_sample_MDA.dta"
file /Users/Martin/Desktop/birthweight_sample_MDA.dta saved
4 . regress bwght cigs, motheduc, fatheduc, parity
invalid 'fatheduc'
r(198);
5 . regress bwght cigs motheduc fatheduc parity
Source |
SS
df
MS
> umber of obs =
1023
-------------+-----------------------------> ( 4, 1018) = 10.70
Model | 17099.0138
4 4274.75344

N
F
Prob > F

= 0.

R-squared

= 0.

0000
Residual | 406513.555 1018 399.325693
0404
-------------+------------------------------

Adj R-squared = 0.

0366
Total | 423612.569 1022 414.493707

Root MSE

= 19

.983
----------------------------------------------------------------------------bwght |

Coef.

Std. Err.

P>|t|

[95% Conf. Inter

val]
-------------+------------------------------------------------------------

---cigs | -.6084993

.1177567

-5.17

0.000

-.839573

-.377

motheduc | -.3955033

.3392632

-1.17

0.244

-1.061238

.270

fatheduc |

.7547259

.2870757

2.63

0.009

.1913981

1.31

parity |

1.626538

.7212122

2.26

0.024

.211306

3.04

_cons |

113.3513

4.027182

28.15

0.000

105.4488

121.

4255
2318
8054
1771
2538
----------------------------------------------------------------------------6 . ssc install outreg2
checking outreg2 consistency and verifying not already installed...
installing into /Users/Martin/Library/Application Support/Stata/ado/stbplu
s/...
installation complete.
7 . regress bwght cigs motheduc fatheduc parity
Source |

SS

df

MS

Number of obs =

1023
-------------+------------------------------

F( 4, 1018) =

0.70
Model | 17099.0138

4 4274.75344

Prob > F

= 0.

R-squared

= 0.

0000
Residual | 406513.555 1018 399.325693
0404
-------------+------------------------------

Adj R-squared = 0.

0366
Total | 423612.569 1022 414.493707

Root MSE

= 19

.983
----------------------------------------------------------------------------bwght |

Coef.

Std. Err.

P>|t|

[95% Conf. Inter

val]
-------------+--------------------------------------------------------------cigs | -.6084993

.1177567

-5.17

0.000

-.839573

-.377

motheduc | -.3955033

.3392632

-1.17

0.244

-1.061238

.270

fatheduc |

.7547259

.2870757

2.63

0.009

.1913981

1.31

parity |

1.626538

.7212122

2.26

0.024

.211306

3.04

_cons |

113.3513

4.027182

28.15

0.000

105.4488

121.

4255
2318
8054
1771
2538
----------------------------------------------------------------------------8 .
9 .
10 . outreg2 using "/Users/Martin/Desktop/multipleregression1.xls", excel re
place
~/Library/Application Support/Stata/ado/stbplus/o/outreg2.ado
/Users/Martin/Desktop/multipleregression1.xls

dir : seeout
11 . seeout using "/Users/Martin/Desktop/multipleregression1.txt"
Hit Enter to continue. gen motheducHS=0
12 . gen motheducHS=0
13 . replace motheducHS=1 if motheduc>=12
(1000 real changes made)
14 . sdtest cigs, by(motheducHS)
Variance ratio test
----------------------------------------------------------------------------Group |

Obs

Mean

Std. Err.

Std. Dev.

[95% Conf. Inter

val]
---------+------------------------------------------------------------------0 |

194

4.927835

.648555

9.033326

3.648669

6.20

1 |

1000

1.598

.1667039

5.27164

1.27087

1.9

7001
2513
---------+------------------------------------------------------------------combined |

1194

2.139028

.1783564

6.162981

1.789101

2.48

8956
----------------------------------------------------------------------------ratio = sd(0) / sd(1)

f =

2.

9363
Ho: ratio = 1

degrees of freedom = 193,

999
Ha: ratio < 1

Ha: ratio != 1

Ha: ratio >

Pr(F < f) = 1.0000

2*Pr(F > f) = 0.0000

1
Pr(F > f) = 0.

0000
15 . ttest cigs, by(motheducHS)
Two-sample t test with equal variances
----------------------------------------------------------------------------Group |

Obs

Mean

Std. Err.

Std. Dev.

[95% Conf. Inter

val]
---------+------------------------------------------------------------------0 |

194

4.927835

.648555

9.033326

3.648669

6.20

1 |

1000

1.598

.1667039

5.27164

1.27087

1.9

7001
2513
---------+------------------------------------------------------------------combined |

1194

2.139028

.1783564

6.162981

1.789101

2.48

8956
---------+------------------------------------------------------------------diff |
9773

3.329835

.473985

2.399897

4.25

----------------------------------------------------------------------------diff = mean(0) - mean(1)

t =

7.

0252
Ho: diff = 0

degrees of freedom =

1192
Ha: diff < 0

Ha: diff != 0

Ha: diff >

Pr(T < t) = 1.0000

Pr(|T| > |t|) = 0.0000

0
Pr(T > t) = 0.

0000
16 . ttest cigs, by(motheducHS) unequal
Two-sample t test with unequal variances
----------------------------------------------------------------------------Group |

Obs

Mean

Std. Err.

Std. Dev.

[95% Conf. Inter

val]
---------+------------------------------------------------------------------0 |

194

4.927835

.648555

9.033326

3.648669

6.20

1 |

1000

1.598

.1667039

5.27164

1.27087

1.9

7001
2513
---------+------------------------------------------------------------------combined |

1194

2.139028

.1783564

6.162981

1.789101

2.48

8956
---------+------------------------------------------------------------------diff |

3.329835

.6696371

2.010083

4.64

9588
----------------------------------------------------------------------------diff = mean(0) - mean(1)

t =

4.

Satterthwaite's degrees of freedom =

21

9726
Ho: diff = 0
9.16
Ha: diff < 0

Ha: diff != 0

Pr(T < t) = 1.0000

Pr(|T| > |t|) = 0.0000

Ha: diff >

0
Pr(T > t) = 0.

0000
17 . gen male=1
male already defined
r(110);
18 . regress bwght cigs motheduc fatheduc parity male white
Source |

SS

df

MS

Number of obs =

1023
-------------+------------------------------

F( 6, 1016) =

0.60
Model | 24962.6217

6 4160.43694

Prob > F

= 0.

R-squared

= 0.

0000
Residual | 398649.947 1016 392.371995
0589
-------------+------------------------------

Adj R-squared = 0.

0534
Total | 423612.569 1022 414.493707

Root MSE

= 19

.808
----------------------------------------------------------------------------bwght |

Coef.

Std. Err.

P>|t|

[95% Conf. Inter

val]
-------------+--------------------------------------------------------------cigs | -.6032602

.116816

-5.16

0.000

-.8324884

-.37

motheduc | -.3722398

.3363433

-1.11

0.269

-1.032247

.287

4032
7672
fatheduc |

.6498313

.286042

2.27

0.023

.0885305

1.21

parity |

1.76451

.7162411

2.46

0.014

.3590288

3.16

male |

4.16352

1.240763

3.36

0.001

1.728769

6.5

white |

5.306876

1.718572

3.09

0.002

1.934518

8.67

_cons |

107.5975

4.214385

25.53

0.000

99.3276

115.

1132
9991
9827
9233
8674
----------------------------------------------------------------------------19 . seeout using "/Users/Martin/Desktop/multipleregression2.txt"
file /Users/Martin/Desktop/multipleregression2.txt not found
r(601);
20 . outreg2 using "/Users/Martin/Desktop/multipleregression2.xls", excel re
place
/Users/Martin/Desktop/multipleregression2.xls
dir : seeout
21 . seeout using "/Users/Martin/Desktop/multipleregression2.txt"
Hit Enter to continue. gen cigssq = cigs^2
22 .
23 . regress bwght cigs motheduc fatheduc parity male white cigssq
variable cigssq not found
r(111);
24 . gen cigssq = cigs^2
25 .
26 . regress bwght cigs motheduc fatheduc parity male white cigssq
Source |

SS

df

MS

Number of obs =

1023
-------------+------------------------------

F( 7, 1015) =

9.44
Model | 25897.7027

7 3699.67182

Prob > F

= 0.

R-squared

= 0.

0000
Residual | 397714.866 1015 391.837307
0611
-------------+------------------------------

Adj R-squared = 0.

0547
Total | 423612.569 1022 414.493707

Root MSE

= 19

.795
----------------------------------------------------------------------------bwght |

Coef.

Std. Err.

P>|t|

[95% Conf. Inter

val]
-------------+--------------------------------------------------------------cigs | -.9883917

.2752856

-3.59

0.000

-1.528586

-.448

motheduc | -.4018567

.3366604

-1.19

0.233

-1.062487

.258

fatheduc |

.6527225

.2858532

2.28

0.023

.0917917

1.21

parity |

1.746201

.715851

2.44

0.015

.3414835

3.15

male |

4.103244

1.240531

3.31

0.001

1.668946

6.53

white |

5.412102

1.718751

3.15

0.002

2.03939

8.78

cigssq |

.0159804

.0103447

1.54

0.123

-.004319

.036

_cons |

108.083

4.223221

25.59

0.000

99.79572

116.

1976
7734
3653
0918
7543
4815
2798
3702
----------------------------------------------------------------------------27 . regress lbwght cigs motheduc fatheduc parity male white
Source |

SS

df

MS

Number of obs =

1023
-------------+------------------------------

F( 6, 1016) =

9.43
Model | 1.97643659

6 .329406098

Prob > F

= 0.

R-squared

= 0.

0000
Residual | 35.4769829 1016

.03491829

0528
-------------+------------------------------

Adj R-squared = 0.

0472
Total | 37.4534195 1022 .036647181

Root MSE

= .1

8686
----------------------------------------------------------------------------lbwght |

Coef.

Std. Err.

P>|t|

[95% Conf. Inter

val]
-------------+--------------------------------------------------------------cigs | -.0052366

.001102

-4.75

0.000

-.0073991

-.003

motheduc | -.0032223

.0031729

-1.02

0.310

-.0094485

.00

fatheduc |

.0052945

.0026984

1.96

0.050

-6.17e-07

.010

parity |

.016894

.0067567

2.50

0.013

.0036353

.030

male |

.0365544

.0117049

3.12

0.002

.0135859

.059

white |

.0527622

.0162123

3.25

0.001

.0209487

.084

0742
3004
5896
1528
5228
5757

_cons |

4.659511

.0397568

117.20

0.000

4.581496

4.73

7526
----------------------------------------------------------------------------28 . regress bwght cigs motheduc fatheduc parity male white cigssq
Source |

SS

df

MS

Number of obs =

1023
-------------+------------------------------

F( 7, 1015) =

9.44
Model | 25897.7027

7 3699.67182

Prob > F

= 0.

R-squared

= 0.

0000
Residual | 397714.866 1015 391.837307
0611
-------------+------------------------------

Adj R-squared = 0.

0547
Total | 423612.569 1022 414.493707

Root MSE

= 19

.795
----------------------------------------------------------------------------bwght |

Coef.

Std. Err.

P>|t|

[95% Conf. Inter

val]
-------------+--------------------------------------------------------------cigs | -.9883917

.2752856

-3.59

0.000

-1.528586

-.448

motheduc | -.4018567

.3366604

-1.19

0.233

-1.062487

.258

fatheduc |

.6527225

.2858532

2.28

0.023

.0917917

1.21

parity |

1.746201

.715851

2.44

0.015

.3414835

3.15

male |

4.103244

1.240531

3.31

0.001

1.668946

6.53

white |

5.412102

1.718751

3.15

0.002

2.03939

8.78

cigssq |

.0159804

.0103447

1.54

0.123

-.004319

.036

_cons |

108.083

4.223221

25.59

0.000

99.79572

116.

1976
7734
3653
0918
7543
4815
2798
3702
----------------------------------------------------------------------------29 . outreg2 using "/Users/Martin/Desktop/multipleregression3.xls", excel re
place
/Users/Martin/Desktop/multipleregression3.xls
dir : seeout
30 . seeout using "/Users/Martin/Desktop/multipleregression3.txt"
Hit Enter to continue. regress lbwght cigs motheduc fatheduc parity male w
hite
31 .
32 .
33 . regress bwght cigs motheduc fatheduc parity male white
Source |
1023

SS

df

MS

Number of obs =

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

F( 6, 1016) =

0.60
Model | 24962.6217

6 4160.43694

Prob > F

= 0.

R-squared

= 0.

0000
Residual | 398649.947 1016 392.371995
0589
-------------+------------------------------

Adj R-squared = 0.

0534
Total | 423612.569 1022 414.493707

Root MSE

= 19

.808
----------------------------------------------------------------------------bwght |

Coef.

Std. Err.

P>|t|

[95% Conf. Inter

val]
-------------+--------------------------------------------------------------cigs | -.6032602

.116816

-5.16

0.000

-.8324884

-.37

motheduc | -.3722398

.3363433

-1.11

0.269

-1.032247

.287

4032
7672
fatheduc |

.6498313

.286042

2.27

0.023

.0885305

1.21

parity |

1.76451

.7162411

2.46

0.014

.3590288

3.16

male |

4.16352

1.240763

3.36

0.001

1.728769

6.5

white |

5.306876

1.718572

3.09

0.002

1.934518

8.67

_cons |

107.5975

4.214385

25.53

0.000

99.3276

115.

1132
9991
9827
9233
8674
----------------------------------------------------------------------------34 . seeout using "/Users/Martin/Desktop/multipleregression4.txt"
file /Users/Martin/Desktop/multipleregression4.txt not found
r(601);
35 . outreg2 using "/Users/Martin/Desktop/multipleregression4.xls", excel re
place
/Users/Martin/Desktop/multipleregression4.xls
dir : seeout
36 . seeout using "/Users/Martin/Desktop/multipleregression4.txt"
Hit Enter to continue. translate @Results mylog.txt
37 .
38 . translate @Results mylog.txt

Anda mungkin juga menyukai