Download Lab1solution

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Name __________________________
Date_______________
Please turn in at the end of lab.
II. Exercises
1. Opening STATA dataset, checking and describing dataset.
Using lowbwt from: http://www.stat.brown.edu/Zwu/PHP2500.aspx
Save this file into your temp directory and open in STATA.
a. How many observations are in this dataset? (answer 100)
b. How many variables are in this dataset? (answer 6)
. describe
Contains data from G:\My Documents\Brown\Biostatistics\Data\lowbwt.dta
obs:
100
vars:
6
size:
5,200 (99.9% of memory free)
----------------------------------------------------------------------------storage display
value
variable name
type
format
label
variable label
----------------------------------------------------------------------------sbp
double %9.0f
systolic blood pressure
sex
double %9.0f
sex
gender
tox
double %9.0f
tox
toxemia diagnosis for mother
grmhem
double %9.0f
grmhem
germinal matrix hemorrhage
gestage
double %9.0f
gestational age
apgar5
double %9.0f
apgar score at five minutes
----------------------------------------------------------------------------Sorted by:
c. Using the information from describe and from the data browser please identify the type of
each variable:
sbp:
nominal categorical
ordinal categorical
continuous numeric
discrete numeric
sex:
nominal categorical
ordinal categorical
continuous numeric
discrete numeric
tox:
nominal categorical
ordinal categorical
continuous numeric
discrete numeric
grmhem:
nominal categorical
ordinal categorical
continuous numeric
discrete numeric
gestage:
nominal categorical
ordinal categorical
continuous numeric
discrete numeric
apgar5:
nominal categorical
ordinal categorical
continuous numeric
discrete numeric
d. Generally apgar scores 3 or below are considered critical, scores 4-6 are considered low and
scores 7+ are considered normal. Please create a new variable named status with the values
1=critical, 2=low and 3=normal.
What type of variable is status?
nominal categorical
ordinal categorical
continuous numeric
discrete numeric
gen status=1 if apgar5<=3
replace status=2 if apgar5>=4 &apgar5<=6
replace status=3 if apgar5>=7
2. Summarize variables
a. What percent of babies are considered “critical” according to the apgar5 score? (answer 14%)
b. What percent of babies are considered “normal” according to the apgar5 score? (answer 60%)
Page 1 of 2
. tab status
status |
Freq.
Percent
Cum.
------------+----------------------------------1 |
14
14.00
14.00
2 |
26
26.00
40.00
3 |
60
60.00
100.00
------------+----------------------------------Total |
100
100.00
a. What is the mean systolic blood pressure? (47.08)
b. What is the median systolic blood pressure? (47)
c. What is the 90% centile of systolic blood pressure? (63)
d. What is the range for systolic blood pressure? (19 – 87)
e. What is the interquartile range (Q3-Q1)? ((52.5 – 40)=12.5)
f. What is the variance? (130.03)
g. What is the standard deviation? (11.40)
h. 25% of observations have a systolic blood pressure below _______. (40)
. sum sbp, detail
systolic blood pressure
------------------------------------------------------------Percentiles
Smallest
1%
21.5
19
5%
28
24
10%
32.5
25
Obs
100
25%
40
26
Sum of Wgt.
100
50%
75%
90%
95%
99%
47
52.5
63
65
81
Largest
66
67
75
87
Mean
Std. Dev.
47.08
11.40324
Variance
Skewness
Kurtosis
130.0339
.3480732
3.858349
i. What is the mean systolic blood pressure for babies with a diagnosis of germinal matrix
hemorrhage? (42.2)
j. What is the mean systolic blood pressure for babies without a diagnosis of germinal matrix
hemorrhage? (47.94)
. sort grmhem
. by grmhem:sum sbp
-----------------------------------------------------------------------------> grmhem = No
Variable |
Obs
Mean
Std. Dev.
Min
Max
-------------+-------------------------------------------------------sbp |
85
47.94118
11.33195
24
87
-> grmhem = Yes
Variable |
Obs
Mean
Std. Dev.
Min
Max
-------------+-------------------------------------------------------sbp |
15
42.2
10.91002
19
62
Page 2 of 2
Related documents