Sei sulla pagina 1di 8

Shella Mae P.

Jalique
MS Bio-I
Stat233(Biostatistics)
I.

March 16, 2016

Using the auto.dta


a. Describe the variables length and make.

b. Complete the following table.


Some Summary Statistics
Price

Weight

Car Type
Foreign
6384.682
6874439
1.215236
3.555178
2315.909
187492
1.056582
3.368013

Mean
Variance
Skewness
Kurtosis
Mean
Variance
Skewness
Kurtosis

Domestic

c. Give a cross-tabulation of the variables car type (foreign) and mileage


(mpg) only for mileage between 20 and 25, exclusive (units of
distance).
c.1 Show the frequencies only

Car
type
(foreign
)

Mileage (mpg)
20
21
0
2

22
0

23
3

24
1

25
4

23
3

24
1

25
4

c.2 Show the percentages only.

Car
type
(foreign
)

Mileage (mpg)
20
21
0
2

22
0

Shella Mae P. Jalique


MS Bio-I
Stat233(Biostatistics)

II.

March 16, 2016

Using the system data named auto, execute the following commands,
describe the use of the command and show the results with analysis.
1. ttest mpg, by (foreign)
Two-sample t test with equal variances
Group

Obs

Mean

Domestic
Foreign

52
22

combined

74

diff

Std. Err.

Std. Dev.

[95% Conf. Interval]

19.82692
24.77273

.657777
1.40951

4.743297
6.611187

18.50638
21.84149

21.14747
27.70396

21.2973

.6725511

5.785503

19.9569

22.63769

-4.945804

1.362162

-7.661225

-2.230384

diff = mean(Domestic) - mean(Foreign)


Ho: diff = 0
Ha: diff < 0
Pr(T < t) = 0.0003

t = -3.6308
degrees of freedom =
72

Ha: diff != 0
Pr(|T| > |t|) = 0.0005

2. a)tabulate rep78 foreign, chi2


Repair
Record
1978

Car type
Domestic
Foreign

Ha: diff > 0


Pr(T > t) = 0.9997

Total

1
2
3
4
5

2
8
27
9
2

0
0
3
9
9

2
8
30
18
11

Total

48

21

69

Pearson chi2(4) =

27.2640

b) tabulate rep78 foreign, chi2 exact


Enumerating sample-space
stage 5: enumerations =
stage 4: enumerations =
stage 3: enumerations =
stage 2: enumerations =
stage 1: enumerations =
Repair
Record
1978

Pr = 0.000

combinations:
1
3
24
203
0

Car type
Domestic
Foreign

Total

1
2
3
4
5

2
8
27
9
2

0
0
3
9
9

2
8
30
18
11

Total

48

21

69

Pearson chi2(4) =
Fisher's exact =

27.2640

Pr = 0.000
0.000

Shella Mae P. Jalique


MS Bio-I
Stat233(Biostatistics)

March 16, 2016

Shella Mae P. Jalique


MS Bio-I
Stat233(Biostatistics)

March 16, 2016

3. a) correlate price mpg weight rep78


. correlate price mpg weight rep78
(obs=69)

price
mpg
weight
rep78

price

mpg

weight

rep78

1.0000
-0.4559
0.5478
0.0066

1.0000
-0.8055
0.4023

1.0000
-0.4003

1.0000

b) pwcorr price mpg weight rep78, obs


. pwcorr price mpg weight rep78, obs
price

mpg

weight

price

1.0000
74

mpg

-0.4686
74

1.0000
74

weight

0.5386
74

-0.8072
74

1.0000
74

rep78

0.0066
69

0.4023
69

-0.4003
69

rep78

1.0000
69

c) Replace the pwcorr option obs with print(.10), sig, star(.05)


price

mpg

weight

price

1.0000
74

mpg

-0.4686
74

1.0000
74

weight

0.5386
74

-0.8072
74

1.0000
74

rep78

0.0066
69

0.4023
69

-0.4003
69

rep78

1.0000
69

Shella Mae P. Jalique


MS Bio-I
Stat233(Biostatistics)

March 16, 2016

4. a) drop if (rep78 <=2) |(rep78==.)

. drop if (rep78 <=2) | (rep78==.)


(15 observations deleted)
b) regress mpg price weight
Source

SS

df

MS

Model
Residual

1375.62097
804.616322

2
56

687.810483
14.3681486

Total

2180.23729

58

37.5902981

mpg

Coef.

price
weight
_cons

-.0000139
-.005828
39.08279

Std. Err.

.0002108
.0007301
1.855011

-0.07
-7.98
21.07

Number of obs
F( 2,
56)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|

=
=
=
=
=
=

59
47.87
0.0000
0.6310
0.6178
3.7905

[95% Conf. Interval]

0.948
0.000
0.000

-.0004362
-.0072906
35.36676

.0004084
-.0043654
42.79882

5. a) oneway mpg rep78


Analysis of Variance
SS
df
MS

Source
Between groups
Within groups
Total

506.325167
1673.91212

2
56

253.162583
29.8912879

2180.23729

58

37.5902981

Bartlett's test for equal variances:

chi2(2) =

Prob > F

8.47

9.9384

0.0006

Prob>chi2 = 0.007

b) oneway mpg rep78, tabulate


Repair
Record 1978

Summary of Mileage (mpg)


Mean
Std. Dev.
Freq.

3
4
5

19.433333
21.666667
27.363636

4.1413252
4.9348699
8.7323849

30
18
11

Total

21.59322

6.1310927

59

Source
Between groups
Within groups
Total

Analysis of Variance
SS
df
MS
506.325167
1673.91212

2
56

253.162583
29.8912879

2180.23729

58

37.5902981

Bartlett's test for equal variances:

chi2(2) =

Prob > F

8.47

9.9384

0.0006

Prob>chi2 = 0.007

Shella Mae P. Jalique


March 16, 2016
MS Bio-I
Stat233(Biostatistics)
c) Replace the option tabulate with other options to investigate their use.
Command: oneway mpg rep78, obs
. oneway mpg rep78, obs

Repair
Record 1978

Summary of
Mileage
(mpg)
Obs.

3
4
5

30
18
11

Total

59
Analysis of Variance
SS
df
MS

Source
Between groups
Within groups
Total

506.325167
1673.91212

2
56

253.162583
29.8912879

2180.23729

58

37.5902981

Bartlett's test for equal variances:

chi2(2) =

Prob > F

8.47

9.9384

0.0006

Prob>chi2 = 0.007

6. anova mpg rep78 price weight, continuous(price weight)

Shella Mae P. Jalique


MS Bio-I
Stat233(Biostatistics)

March 16, 2016

Shella Mae P. Jalique


MS Bio-I
Stat233(Biostatistics)

March 16, 2016

Potrebbero piacerti anche