Functions are extremely useful tools in R. They power the packages we rely on and the statistical analyses we run.
In addition, we can write our own bespoke functions to handle repetitive operations or to make our analyses more flexible. Gaining intuition with writing functions takes time, but hopefully a simple example will suffice to demonstrate their usefulness.
In the following example, we’ll look at an example in which we want to run a logistic regression repeatedly, feeding it different sets of independent variables.
Let’s begin by simulating some fake data.
In the code below, we simulate a dataset containing 500 rows and encoding the following relationships between the variables L, M, X, and Y, where Y is some outcome and i is used as the participant ID.
For simplicity, all variables (besides i) are binary, taking either 1 or 0 as their value.
\[ \begin{split} L & \sim \text{Bernoulli}\big(0.3\big) \\ M & \sim \text{Bernoulli}\big(0.6\big) \\ X & \sim \text{Bernoulli}\big(0.3 + 0.2L + 0.2M\big) \\ Y & \sim \text{Bernoulli}\big(0.05 + 0.2L + 0.4M + 0.05X\big) \end{split} \]
# simulate some data
500
n <-
set.seed(3498743)
tibble(
df <-i = 1:n,
l = rbinom(n, 1, 0.3),
m = rbinom(n, 1, 0.6),
x = rbinom(n, 1, 0.3 + 0.2 * l + 0.2 * m),
y = rbinom(n, 1, 0.05 + 0.2 * l + 0.4 * m + 0.05 * x)
)
print(df)
# A tibble: 500 × 5
i l m x y
<int> <int> <int> <int> <int>
1 1 0 1 0 0
2 2 0 1 1 1
3 3 1 1 1 1
4 4 0 1 0 0
5 5 1 1 1 0
6 6 0 1 0 0
7 7 0 1 1 1
8 8 0 0 1 0
9 9 0 1 1 0
10 10 0 1 1 0
# … with 490 more rows
What Did We Simulate?
Warning: `data_frame()` was deprecated in tibble 1.1.0.
Please use `tibble()` instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
Let’s say we are interested in estimating the effect of some exposure X on some outcome Y under different assumptions about the set of relevant adjustment covariates.
We could simply rewrite code individually for each of our analyses of interest.
# run analyses using different independent covariates
glm("y ~ x", data = df, family = binomial())
fit1 <- glm("y ~ x + l", data = df, family = binomial())
fit2 <- glm("y ~ x + l + m", data = df, family = binomial())
fit3 <-
# view model summaries
# broom::tidy()
tidy(fit1, exponentiate = TRUE)
# A tibble: 2 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.406 0.136 -6.62 3.62e-11
2 x 1.96 0.189 3.56 3.72e- 4
tidy(fit2, exponentiate = TRUE)
# A tibble: 3 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.326 0.151 -7.45 9.56e-14
2 x 1.73 0.194 2.82 4.77e- 3
3 l 2.23 0.200 4.00 6.29e- 5
tidy(fit3, exponentiate = TRUE)
# A tibble: 4 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.0862 0.250 -9.79 1.25e-22
2 x 1.21 0.216 0.865 3.87e- 1
3 l 3.07 0.231 4.86 1.17e- 6
4 m 8.45 0.251 8.52 1.61e-17
The code above works just fine, but it violates one of the truly helpful heuristics in programming: Don’t Repeat Yourself (DRY). Basically, the idea is that if you find yourself reusing blocks of code repeatedly, put that code into a function that you write once instead of n times.
Adhering to the DRY heuristic can help the coder in several ways:
One approach to functionalizing our analysis would be to write a function that takes a single argument, the right-hand side (RHS) of the models we’d like to run. Then, we could simply run the function three times, feeding in each covariate set directly
function(vars) {
regfun <- glm(paste0("y ~ ", vars), data = df, family = binomial())
fit <-tidy(fit, exponentiate = TRUE)
}
# run analyses
regfun("x")
# A tibble: 2 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.406 0.136 -6.62 3.62e-11
2 x 1.96 0.189 3.56 3.72e- 4
regfun("x + l")
# A tibble: 3 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.326 0.151 -7.45 9.56e-14
2 x 1.73 0.194 2.82 4.77e- 3
3 l 2.23 0.200 4.00 6.29e- 5
regfun("x + l + m")
# A tibble: 4 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.0862 0.250 -9.79 1.25e-22
2 x 1.21 0.216 0.865 3.87e- 1
3 l 3.07 0.231 4.86 1.17e- 6
4 m 8.45 0.251 8.52 1.61e-17
If we tried to be a little more elegant, we might try to avoid repeated calls to the regfun()
function. Let’s write some code that loops through a vector of RHS options and spits out each analysis.
## specify the righthand side equations we'd like to test
c("x",
rhs <-"x + l")
## purrr::map()
map(rhs, .f = function(x) regfun(vars = x))
[[1]]
# A tibble: 2 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.406 0.136 -6.62 3.62e-11
2 x 1.96 0.189 3.56 3.72e- 4
[[2]]
# A tibble: 3 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.326 0.151 -7.45 9.56e-14
2 x 1.73 0.194 2.82 4.77e- 3
3 l 2.23 0.200 4.00 6.29e- 5
for (i in seq_along(rhs)) {
print(regfun(rhs[i]))
}
# A tibble: 2 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.406 0.136 -6.62 3.62e-11
2 x 1.96 0.189 3.56 3.72e- 4
# A tibble: 3 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.326 0.151 -7.45 9.56e-14
2 x 1.73 0.194 2.82 4.77e- 3
3 l 2.23 0.200 4.00 6.29e- 5
What if you want to add a new analysis? Easy!
Of course, you’d probably just add the new covariate set to the rhs
vector above and rerun thecode, but for the sake of exposition:
c(rhs, "x + l + m")
rhs2 <-map(rhs2, .f = function(x) regfun(vars = x))
[[1]]
# A tibble: 2 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.406 0.136 -6.62 3.62e-11
2 x 1.96 0.189 3.56 3.72e- 4
[[2]]
# A tibble: 3 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.326 0.151 -7.45 9.56e-14
2 x 1.73 0.194 2.82 4.77e- 3
3 l 2.23 0.200 4.00 6.29e- 5
[[3]]
# A tibble: 4 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.0862 0.250 -9.79 1.25e-22
2 x 1.21 0.216 0.865 3.87e- 1
3 l 3.07 0.231 4.86 1.17e- 6
4 m 8.45 0.251 8.52 1.61e-17
If you know you’re going to run regfun()
multiple times, build looping into the function from the start and write even less!
function(vars) {
regfun_looper <-# purrr::map()
map(vars, .f = function(x = vars) {
glm(paste0("y ~ ", x), data = df, family = binomial())
fit <-tidy(fit, exponentiate = TRUE)
})
}
## voila!
regfun_looper(rhs2)
[[1]]
# A tibble: 2 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.406 0.136 -6.62 3.62e-11
2 x 1.96 0.189 3.56 3.72e- 4
[[2]]
# A tibble: 3 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.326 0.151 -7.45 9.56e-14
2 x 1.73 0.194 2.82 4.77e- 3
3 l 2.23 0.200 4.00 6.29e- 5
[[3]]
# A tibble: 4 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 0.0862 0.250 -9.79 1.25e-22
2 x 1.21 0.216 0.865 3.87e- 1
3 l 3.07 0.231 4.86 1.17e- 6
4 m 8.45 0.251 8.52 1.61e-17
The code below provides a SAS approximation of “A New Way, Part 1”.
* SIMULATE DATA =============================================== ;
%let n = 500;
data sim;
call streaminit(341324);
do i=1 to &n;
l = rand('Bernoulli', 0.3);
m = rand('Bernoulli', 0.6);
x = rand('Bernoulli', 0.3 + 0.2 * l + 0.2 * m);
y = rand('Bernoulli', 0.05 + 0.2 * l + 0.4 * m + 0.05 * x);
output;
end;
run;
proc print data=sim(obs=20); run;
* RUN FIRST LOGISTIC REGRESSION MODEL ======================== ;
title "FIRST LOGISTIC REGRESSION MODEL";
proc genmod data=sim;
model y(ref='0') = x / dist=bin link=logit;
estimate 'x effect' x 1 /exp;
run;
* RUN SECOND LOGISTIC REGRESSION MODEL ===== ;
title "SECOND LOGISTIC REGRESSION MODEL";
proc genmod data=sim;
model y(ref='0') = x l / dist=bin link=logit;
estimate 'x effect, ctrl l' x 1 /exp;
run;
title;
* WRITE A MACRO THAT TAKES INPUTS =========================== ;
* In SAS macros are somewhat analagous to R functions. ;
%macro regfun(vars=, estname=, fitnum=);
proc genmod data=sim;
model y(ref='0') = &vars / dist=bin link=logit;
estimate &estname x 1 /exp;
run;
%mend regfun;
title "FIRST RUN OF THE REGFUN MACRO";
%regfun(vars = x, estname = 'x effect', fitnum = fit1);
title "SECOND RUN OF THE REGFUN MACRO";
%regfun(vars = x, estname = 'x effect, ctrl l', fitnum = fit2);
title;
The SAS System 1
20:39 Thursday, December 15, 2022
Obs Sepal_Length Sepal_Width Petal_Length Petal_Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
The SAS System 2
20:39 Thursday, December 15, 2022
Obs Sepal_Length Sepal_Width Petal_Length Petal_Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
7 4.6 3.4 1.4 0.3 setosa
8 5 3.4 1.5 0.2 setosa
9 4.4 2.9 1.4 0.2 setosa
10 4.9 3.1 1.5 0.1 setosa
The SAS System 3
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS Observations 1629
Member Type DATA Variables 64
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 512
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 13
First Data Page 1
Max Obs per Page 127
Obs in First Data Page 107
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998378
Access Permission rw-rw-r--
Owner Name jrgant
File Size 896KB
File Size (bytes) 917504
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
53 active Num 8 BEST12. BEST32.
10 age Num 8 BEST12. BEST32.
39 alcoholfreq Num 8 BEST12. BEST32.
41 alcoholhowmuch Num 8 BEST12. BEST32.
38 alcoholpy Num 8 BEST12. BEST32.
40 alcoholtype Num 8 BEST12. BEST32.
46 allergies Num 8 BEST12. BEST32.
24 asthma Num 8 BEST12. BEST32.
55 birthcontrol Num 8 BEST12. BEST32.
20 birthplace Num 8 BEST12. BEST32.
50 boweltrouble Num 8 BEST12. BEST32.
25 bronch Num 8 BEST12. BEST32.
57 cholesterol Num 8 BEST12. BEST32.
32 chroniccough Num 8 BEST12. BEST32.
30 colitis Num 8 BEST12. BEST32.
6 dadth Num 8 BEST12. BEST32.
8 dbp Num 8 BEST12. BEST32.
3 death Num 8 BEST12. BEST32.
The SAS System 4
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
34 diabetes Num 8 BEST12. BEST32.
15 education Num 8 BEST12. BEST32.
54 exercise Num 8 BEST12. BEST32.
33 hayfever Num 8 BEST12. BEST32.
28 hbp Num 8 BEST12. BEST32.
49 hbpmed Num 8 BEST12. BEST32.
43 headache Num 8 BEST12. BEST32.
31 hepatitis Num 8 BEST12. BEST32.
27 hf Num 8 BEST12. BEST32.
58 hightax82 Num 8 BEST12. BEST32.
16 ht Num 8 BEST12. BEST32.
12 income Num 8 BEST12. BEST32.
52 infection Num 8 BEST12. BEST32.
48 lackpep Num 8 BEST12. BEST32.
13 marital Num 8 BEST12. BEST32.
5 modth Num 8 BEST12. BEST32.
47 nerves Num 8 BEST12. BEST32.
37 nervousbreak Num 8 BEST12. BEST32.
44 otherpain Num 8 BEST12. BEST32.
29 pepticulcer Num 8 BEST12. BEST32.
42 pica Num 8 BEST12. BEST32.
35 polio Num 8 BEST12. BEST32.
56 pregnancies Num 8 BEST12. BEST32.
59 price71 Num 8 BEST12. BEST32.
60 price82 Num 8 BEST12. BEST32.
63 price71_82 Num 8 BEST12. BEST32.
2 qsmk Num 8 BEST12. BEST32.
11 race Num 8 BEST12. BEST32.
7 sbp Num 8 BEST12. BEST32.
14 school Num 8 BEST12. BEST32.
1 seqn Num 8 BEST12. BEST32.
9 sex Num 8 BEST12. BEST32.
22 smkintensity82_71 Num 8 BEST12. BEST32.
21 smokeintensity Num 8 BEST12. BEST32.
23 smokeyrs Num 8 BEST12. BEST32.
61 tax71 Num 8 BEST12. BEST32.
62 tax82 Num 8 BEST12. BEST32.
64 tax71_82 Num 8 BEST12. BEST32.
26 tb Num 8 BEST12. BEST32.
36 tumor Num 8 BEST12. BEST32.
45 weakheart Num 8 BEST12. BEST32.
17 wt71 Num 8 BEST12. BEST32.
18 wt82 Num 8 BEST12. BEST32.
19 wt82_71 Num 8 BEST12. BEST32.
51 wtloss Num 8 BEST12. BEST32.
4 yrdth Num 8 BEST12. BEST32.
The SAS System 5
20:39 Thursday, December 15, 2022
Obs seqn qsmk death yrdth modth
1 233 0 0 . .
2 235 0 0 . .
3 244 0 0 . .
4 245 0 1 85 2
5 252 0 0 . .
Obs dadth sbp dbp sex age
1 . 175 96 0 42
2 . 123 80 0 36
3 . 115 75 1 56
4 14 148 78 0 68
5 . 118 77 0 40
Obs race income marital school education
1 1 19 2 7 1
2 0 18 2 9 2
3 1 15 3 11 2
4 1 15 3 5 1
5 0 18 2 11 2
Obs ht wt71 wt82 wt82_71 birthplace
1 174.1875 79.04 68.94604024 -10.09395976 47
2 159.375 58.63 61.23496995 2.60496995 42
3 168.5 56.81 66.22448602 9.41448602 51
4 170.1875 59.42 64.41011654 4.99011654 37
5 181.875 87.09 92.07925111 4.98925111 42
smkintensity82_
Obs smokeintensity 71 smokeyrs asthma bronch
1 30 -10 29 0 0
2 20 -10 24 0 0
3 20 -14 26 0 0
4 3 4 53 0 0
5 20 0 19 0 0
The SAS System 6
20:39 Thursday, December 15, 2022
Obs tb hf hbp pepticulcer colitis
1 0 0 1 1 0
2 0 0 0 0 0
3 0 0 0 0 0
4 0 0 1 0 0
5 0 0 0 0 0
Obs hepatitis chroniccough hayfever diabetes polio
1 0 0 0 1 0
2 0 0 0 0 0
3 0 0 1 0 0
4 0 0 0 0 0
5 0 0 0 0 0
Obs tumor nervousbreak alcoholpy alcoholfreq alcoholtype
1 0 0 1 1 3
2 0 0 1 0 1
3 1 0 1 3 4
4 0 0 1 2 3
5 0 0 1 2 1
Obs alcoholhowmuch pica headache otherpain weakheart
1 7 0 1 0 0
2 4 0 1 0 0
3 . 0 1 1 0
4 4 0 0 1 1
5 2 0 1 0 0
Obs allergies nerves lackpep hbpmed boweltrouble
1 0 0 0 1 0
2 0 0 0 0 0
3 0 1 0 0 0
4 0 0 0 0 0
5 0 0 0 0 1
The SAS System 7
20:39 Thursday, December 15, 2022
Obs wtloss infection active exercise birthcontrol
1 0 0 0 2 2
2 0 1 0 0 2
3 0 0 0 2 0
4 0 0 1 2 2
5 0 0 1 1 2
Obs pregnancies cholesterol hightax82 price71 price82
1 . 197 0 2.18359375 1.7399902344
2 . 301 0 2.3466796875 1.7973632813
3 2 157 0 1.5695800781 1.5134277344
4 . 174 0 1.5065917969 1.4519042969
5 . 216 0 2.3466796875 1.7973632813
Obs tax71 tax82 price71_82 tax71_82
1 1.1022949219 0.4619750977 0.4437866211 0.6403808594
2 1.3649902344 0.5718994141 0.5493164063 0.79296875
3 0.5512695313 0.2309875488 0.0561981201 0.3202514648
4 0.5249023438 0.2199707031 0.0547943115 0.3049926758
5 1.3649902344 0.5718994141 0.5493164063 0.79296875
The SAS System 8
20:39 Thursday, December 15, 2022
The MEANS Procedure
N
Variable Miss
-------------------------
seqn 0
qsmk 0
death 0
yrdth 1311
modth 1307
dadth 1307
sbp 77
dbp 81
sex 0
age 0
race 0
income 62
marital 0
school 0
education 0
ht 0
wt71 0
wt82 63
wt82_71 63
birthplace 92
smokeintensity 0
smkintensity82_71 0
smokeyrs 0
asthma 0
bronch 0
tb 0
hf 0
hbp 0
pepticulcer 0
colitis 0
hepatitis 0
chroniccough 0
hayfever 0
diabetes 0
polio 0
tumor 0
nervousbreak 0
alcoholpy 0
alcoholfreq 0
alcoholtype 0
alcoholhowmuch 417
pica 0
headache 0
otherpain 0
weakheart 0
allergies 0
nerves 0
lackpep 0
hbpmed 0
boweltrouble 0
wtloss 0
-------------------------
The SAS System 9
20:39 Thursday, December 15, 2022
The MEANS Procedure
N
Variable Miss
-------------------------
infection 0
active 0
exercise 0
birthcontrol 0
pregnancies 903
cholesterol 16
hightax82 92
price71 92
price82 92
tax71 92
tax82 92
price71_82 92
tax71_82 92
-------------------------
The SAS System 10
20:39 Thursday, December 15, 2022
Obs Variable NMiss
1 seqn 0
2 qsmk 0
3 death 0
4 yrdth 1311
5 modth 1307
6 dadth 1307
7 sbp 77
8 dbp 81
9 sex 0
10 age 0
11 race 0
12 income 62
13 marital 0
14 school 0
15 education 0
16 ht 0
17 wt71 0
18 wt82 63
19 wt82_71 63
20 birthplace 92
21 smokeintensity 0
22 smkintensity82_71 0
23 smokeyrs 0
24 asthma 0
25 bronch 0
26 tb 0
27 hf 0
28 hbp 0
29 pepticulcer 0
30 colitis 0
31 hepatitis 0
32 chroniccough 0
33 hayfever 0
34 diabetes 0
35 polio 0
36 tumor 0
37 nervousbreak 0
38 alcoholpy 0
39 alcoholfreq 0
40 alcoholtype 0
41 alcoholhowmuch 417
42 pica 0
43 headache 0
44 otherpain 0
45 weakheart 0
46 allergies 0
47 nerves 0
48 lackpep 0
49 hbpmed 0
50 boweltrouble 0
51 wtloss 0
52 infection 0
53 active 0
54 exercise 0
55 birthcontrol 0
The SAS System 11
20:39 Thursday, December 15, 2022
Obs Variable NMiss
56 pregnancies 903
57 cholesterol 16
58 hightax82 92
59 price71 92
60 price82 92
61 tax71 92
62 tax82 92
63 price71_82 92
64 tax71_82 92
The SAS System 12
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS2 Observations 44
Member Type DATA Variables 64
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 512
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 1
First Data Page 1
Max Obs per Page 127
Obs in First Data Page 44
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs2.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998380
Access Permission rw-rw-r--
Owner Name jrgant
File Size 128KB
File Size (bytes) 131072
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
53 active Num 8 BEST12. BEST32.
10 age Num 8 BEST12. BEST32.
39 alcoholfreq Num 8 BEST12. BEST32.
41 alcoholhowmuch Num 8 BEST12. BEST32.
38 alcoholpy Num 8 BEST12. BEST32.
40 alcoholtype Num 8 BEST12. BEST32.
46 allergies Num 8 BEST12. BEST32.
24 asthma Num 8 BEST12. BEST32.
55 birthcontrol Num 8 BEST12. BEST32.
20 birthplace Num 8 BEST12. BEST32.
50 boweltrouble Num 8 BEST12. BEST32.
25 bronch Num 8 BEST12. BEST32.
57 cholesterol Num 8 BEST12. BEST32.
32 chroniccough Num 8 BEST12. BEST32.
30 colitis Num 8 BEST12. BEST32.
6 dadth Num 8 BEST12. BEST32.
8 dbp Num 8 BEST12. BEST32.
3 death Num 8 BEST12. BEST32.
The SAS System 13
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
34 diabetes Num 8 BEST12. BEST32.
15 education Num 8 BEST12. BEST32.
54 exercise Num 8 BEST12. BEST32.
33 hayfever Num 8 BEST12. BEST32.
28 hbp Num 8 BEST12. BEST32.
49 hbpmed Num 8 BEST12. BEST32.
43 headache Num 8 BEST12. BEST32.
31 hepatitis Num 8 BEST12. BEST32.
27 hf Num 8 BEST12. BEST32.
58 hightax82 Num 8 BEST12. BEST32.
16 ht Num 8 BEST12. BEST32.
12 income Num 8 BEST12. BEST32.
52 infection Num 8 BEST12. BEST32.
48 lackpep Num 8 BEST12. BEST32.
13 marital Num 8 BEST12. BEST32.
5 modth Num 8 BEST12. BEST32.
47 nerves Num 8 BEST12. BEST32.
37 nervousbreak Num 8 BEST12. BEST32.
44 otherpain Num 8 BEST12. BEST32.
29 pepticulcer Num 8 BEST12. BEST32.
42 pica Num 8 BEST12. BEST32.
35 polio Num 8 BEST12. BEST32.
56 pregnancies Num 8 BEST12. BEST32.
59 price71 Num 8 BEST12. BEST32.
60 price82 Num 8 BEST12. BEST32.
63 price71_82 Num 8 BEST12. BEST32.
2 qsmk Num 8 BEST12. BEST32.
11 race Num 8 BEST12. BEST32.
7 sbp Num 8 BEST12. BEST32.
14 school Num 8 BEST12. BEST32.
1 seqn Num 8 BEST12. BEST32.
9 sex Num 8 BEST12. BEST32.
22 smkintensity82_71 Num 8 BEST12. BEST32.
21 smokeintensity Num 8 BEST12. BEST32.
23 smokeyrs Num 8 BEST12. BEST32.
61 tax71 Num 8 BEST12. BEST32.
62 tax82 Num 8 BEST12. BEST32.
64 tax71_82 Num 8 BEST12. BEST32.
26 tb Num 8 BEST12. BEST32.
36 tumor Num 8 BEST12. BEST32.
45 weakheart Num 8 BEST12. BEST32.
17 wt71 Num 8 BEST12. BEST32.
18 wt82 Num 8 BEST12. BEST32.
19 wt82_71 Num 8 BEST12. BEST32.
51 wtloss Num 8 BEST12. BEST32.
4 yrdth Num 8 BEST12. BEST32.
The SAS System 14
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS3 Observations 1552
Member Type DATA Variables 8
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 64
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 2
First Data Page 1
Max Obs per Page 1021
Obs in First Data Page 977
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs3.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998381
Access Permission rw-rw-r--
Owner Name jrgant
File Size 192KB
File Size (bytes) 196608
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
2 age Num 8 BEST12. BEST32.
6 alcoholfreq Num 8 BEST12. BEST32.
8 allergies Num 8 BEST12. BEST32.
5 asthma Num 8 BEST12. BEST32.
1 sbp Num 8 BEST12. BEST32.
4 smokeintensity Num 8 BEST12. BEST32.
7 weakheart Num 8 BEST12. BEST32.
3 wt71 Num 8 BEST12. BEST32.
The SAS System 15
20:39 Thursday, December 15, 2022
The FREQ Procedure
Table of alcfreqcat by alcoholfreq
alcfreqcat alcoholfreq
Frequency|
Percent |
Row Pct |
Col Pct | 0| 1| 2| 3| 4| 5| Total
---------+--------+--------+--------+--------+--------+--------+
. | 0 | 0 | 0 | 0 | 0 | 5 | 5
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.32 | 0.32
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 100.00 |
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 100.00 |
---------+--------+--------+--------+--------+--------+--------+
0 | 320 | 0 | 0 | 0 | 0 | 0 | 320
| 20.62 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 20.62
| 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
1 | 0 | 217 | 0 | 0 | 0 | 0 | 217
| 0.00 | 13.98 | 0.00 | 0.00 | 0.00 | 0.00 | 13.98
| 0.00 | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| 0.00 | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
2 | 0 | 0 | 489 | 0 | 0 | 0 | 489
| 0.00 | 0.00 | 31.51 | 0.00 | 0.00 | 0.00 | 31.51
| 0.00 | 0.00 | 100.00 | 0.00 | 0.00 | 0.00 |
| 0.00 | 0.00 | 100.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
3 | 0 | 0 | 0 | 329 | 0 | 0 | 329
| 0.00 | 0.00 | 0.00 | 21.20 | 0.00 | 0.00 | 21.20
| 0.00 | 0.00 | 0.00 | 100.00 | 0.00 | 0.00 |
| 0.00 | 0.00 | 0.00 | 100.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
4 | 0 | 0 | 0 | 0 | 192 | 0 | 192
| 0.00 | 0.00 | 0.00 | 0.00 | 12.37 | 0.00 | 12.37
| 0.00 | 0.00 | 0.00 | 0.00 | 100.00 | 0.00 |
| 0.00 | 0.00 | 0.00 | 0.00 | 100.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
Total 320 217 489 329 192 5 1552
20.62 13.98 31.51 21.20 12.37 0.32 100.00
The SAS System 16
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS3 Observations 1552
Member Type DATA Variables 9
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 72
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 2
First Data Page 1
Max Obs per Page 908
Obs in First Data Page 866
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs3.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998382
Access Permission rw-rw-r--
Owner Name jrgant
File Size 192KB
File Size (bytes) 196608
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
2 age Num 8 BEST12. BEST32.
9 alcfreqcat Char 1
6 alcoholfreq Num 8 BEST12. BEST32.
8 allergies Num 8 BEST12. BEST32.
5 asthma Num 8 BEST12. BEST32.
1 sbp Num 8 BEST12. BEST32.
4 smokeintensity Num 8 BEST12. BEST32.
7 weakheart Num 8 BEST12. BEST32.
3 wt71 Num 8 BEST12. BEST32.
The SAS System 17
20:39 Thursday, December 15, 2022
Obs sbp age wt71 smokeintensity
1 175 42 79.04 30
2 123 36 58.63 20
3 115 56 56.81 20
4 148 68 59.42 3
5 118 40 87.09 20
Obs asthma weakheart allergies alcfreqcat
1 0 0 0 1
2 0 0 0 0
3 0 0 0 3
4 0 1 0 2
5 0 0 0 2
The SAS System 18
20:39 Thursday, December 15, 2022
The MEANS Procedure
Variable N Mean Std Dev Minimum
----------------------------------------------------------------------
age 1547 43.6528765 12.0298947 25.0000000
wt71 1547 70.9031157 15.3891998 39.5800000
smokeintensity 1547 20.5416936 11.7258480 1.0000000
sbp 1547 128.7039431 19.0608817 87.0000000
----------------------------------------------------------------------
Variable Maximum
------------------------------
age 74.0000000
wt71 151.7300000
smokeintensity 80.0000000
sbp 229.0000000
------------------------------
The SAS System 19
20:39 Thursday, December 15, 2022
The FREQ Procedure
Cumulative Cumulative
asthma Frequency Percent Frequency Percent
-----------------------------------------------------------
0 1474 95.28 1474 95.28
1 73 4.72 1547 100.00
Cumulative Cumulative
allergies Frequency Percent Frequency Percent
--------------------------------------------------------------
0 1448 93.60 1448 93.60
1 99 6.40 1547 100.00
Cumulative Cumulative
alcfreqcat Frequency Percent Frequency Percent
---------------------------------------------------------------
0 320 20.69 320 20.69
1 217 14.03 537 34.71
2 489 31.61 1026 66.32
3 329 21.27 1355 87.59
4 192 12.41 1547 100.00
Cumulative Cumulative
weakheart Frequency Percent Frequency Percent
--------------------------------------------------------------
0 1512 97.74 1512 97.74
1 35 2.26 1547 100.00
The SAS System 20
20:39 Thursday, December 15, 2022
The FREQ Procedure
Cumulative Cumulative
sbp_hi Frequency Percent Frequency Percent
-----------------------------------------------------------
0 1192 76.80 1192 76.80
1 360 23.20 1552 100.00
Frequency Missing = 77
The SAS System 21
20:39 Thursday, December 15, 2022
The FREQ Procedure
Table of sbp_hi by qsmk
sbp_hi qsmk
Frequency|
Percent |
Row Pct |
Col Pct | 0| 1| Total
---------+--------+--------+
0 | 908 | 284 | 1192
| 58.51 | 18.30 | 76.80
| 76.17 | 23.83 |
| 78.34 | 72.26 |
---------+--------+--------+
1 | 251 | 109 | 360
| 16.17 | 7.02 | 23.20
| 69.72 | 30.28 |
| 21.66 | 27.74 |
---------+--------+--------+
Total 1159 393 1552
74.68 25.32 100.00
Frequency Missing = 77
Statistics for Table of sbp_hi by qsmk
Statistic DF Value Prob
------------------------------------------------------
Chi-Square 1 6.0872 0.0136
Likelihood Ratio Chi-Square 1 5.9256 0.0149
Continuity Adj. Chi-Square 1 5.7508 0.0165
Mantel-Haenszel Chi-Square 1 6.0833 0.0136
Phi Coefficient 0.0626
Contingency Coefficient 0.0625
Cramer's V 0.0626
Fisher's Exact Test
----------------------------------
Cell (1,1) Frequency (F) 908
Left-sided Pr <= F 0.9939
Right-sided Pr >= F 0.0088
Table Probability (P) 0.0028
Two-sided Pr <= P 0.0155
Sample Size = 1552
Frequency Missing = 77
The SAS System 22
20:39 Thursday, December 15, 2022
The REG Procedure
Model: MODEL1
Dependent Variable: sbp
Number of Observations Read 1629
Number of Observations Used 1552
Number of Observations with Missing Values 77
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 4673.90689 4673.90689 12.98 0.0003
Error 1550 558280 360.18067
Corrected Total 1551 562954
Root MSE 18.97843 R-Square 0.0083
Dependent Mean 128.70941 Adj R-Sq 0.0077
Coeff Var 14.74517
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 127.69888 0.55747 229.07 <.0001
qsmk 1 3.99069 1.10782 3.60 0.0003
Parameter Estimates
Variable DF 95% Confidence Limits
Intercept 1 126.60541 128.79235
qsmk 1 1.81771 6.16367
The SAS System 23
20:39 Thursday, December 15, 2022
Obs Sepal_Length Sepal_Width Petal_Length Petal_Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
The SAS System 24
20:39 Thursday, December 15, 2022
Obs Sepal_Length Sepal_Width Petal_Length Petal_Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
7 4.6 3.4 1.4 0.3 setosa
8 5 3.4 1.5 0.2 setosa
9 4.4 2.9 1.4 0.2 setosa
10 4.9 3.1 1.5 0.1 setosa
The SAS System 25
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS Observations 1629
Member Type DATA Variables 64
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 512
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 13
First Data Page 1
Max Obs per Page 127
Obs in First Data Page 107
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998378
Access Permission rw-rw-r--
Owner Name jrgant
File Size 896KB
File Size (bytes) 917504
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
53 active Num 8 BEST12. BEST32.
10 age Num 8 BEST12. BEST32.
39 alcoholfreq Num 8 BEST12. BEST32.
41 alcoholhowmuch Num 8 BEST12. BEST32.
38 alcoholpy Num 8 BEST12. BEST32.
40 alcoholtype Num 8 BEST12. BEST32.
46 allergies Num 8 BEST12. BEST32.
24 asthma Num 8 BEST12. BEST32.
55 birthcontrol Num 8 BEST12. BEST32.
20 birthplace Num 8 BEST12. BEST32.
50 boweltrouble Num 8 BEST12. BEST32.
25 bronch Num 8 BEST12. BEST32.
57 cholesterol Num 8 BEST12. BEST32.
32 chroniccough Num 8 BEST12. BEST32.
30 colitis Num 8 BEST12. BEST32.
6 dadth Num 8 BEST12. BEST32.
8 dbp Num 8 BEST12. BEST32.
3 death Num 8 BEST12. BEST32.
The SAS System 26
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
34 diabetes Num 8 BEST12. BEST32.
15 education Num 8 BEST12. BEST32.
54 exercise Num 8 BEST12. BEST32.
33 hayfever Num 8 BEST12. BEST32.
28 hbp Num 8 BEST12. BEST32.
49 hbpmed Num 8 BEST12. BEST32.
43 headache Num 8 BEST12. BEST32.
31 hepatitis Num 8 BEST12. BEST32.
27 hf Num 8 BEST12. BEST32.
58 hightax82 Num 8 BEST12. BEST32.
16 ht Num 8 BEST12. BEST32.
12 income Num 8 BEST12. BEST32.
52 infection Num 8 BEST12. BEST32.
48 lackpep Num 8 BEST12. BEST32.
13 marital Num 8 BEST12. BEST32.
5 modth Num 8 BEST12. BEST32.
47 nerves Num 8 BEST12. BEST32.
37 nervousbreak Num 8 BEST12. BEST32.
44 otherpain Num 8 BEST12. BEST32.
29 pepticulcer Num 8 BEST12. BEST32.
42 pica Num 8 BEST12. BEST32.
35 polio Num 8 BEST12. BEST32.
56 pregnancies Num 8 BEST12. BEST32.
59 price71 Num 8 BEST12. BEST32.
60 price82 Num 8 BEST12. BEST32.
63 price71_82 Num 8 BEST12. BEST32.
2 qsmk Num 8 BEST12. BEST32.
11 race Num 8 BEST12. BEST32.
7 sbp Num 8 BEST12. BEST32.
14 school Num 8 BEST12. BEST32.
1 seqn Num 8 BEST12. BEST32.
9 sex Num 8 BEST12. BEST32.
22 smkintensity82_71 Num 8 BEST12. BEST32.
21 smokeintensity Num 8 BEST12. BEST32.
23 smokeyrs Num 8 BEST12. BEST32.
61 tax71 Num 8 BEST12. BEST32.
62 tax82 Num 8 BEST12. BEST32.
64 tax71_82 Num 8 BEST12. BEST32.
26 tb Num 8 BEST12. BEST32.
36 tumor Num 8 BEST12. BEST32.
45 weakheart Num 8 BEST12. BEST32.
17 wt71 Num 8 BEST12. BEST32.
18 wt82 Num 8 BEST12. BEST32.
19 wt82_71 Num 8 BEST12. BEST32.
51 wtloss Num 8 BEST12. BEST32.
4 yrdth Num 8 BEST12. BEST32.
The SAS System 27
20:39 Thursday, December 15, 2022
Obs seqn qsmk death yrdth modth
1 233 0 0 . .
2 235 0 0 . .
3 244 0 0 . .
4 245 0 1 85 2
5 252 0 0 . .
Obs dadth sbp dbp sex age
1 . 175 96 0 42
2 . 123 80 0 36
3 . 115 75 1 56
4 14 148 78 0 68
5 . 118 77 0 40
Obs race income marital school education
1 1 19 2 7 1
2 0 18 2 9 2
3 1 15 3 11 2
4 1 15 3 5 1
5 0 18 2 11 2
Obs ht wt71 wt82 wt82_71 birthplace
1 174.1875 79.04 68.94604024 -10.09395976 47
2 159.375 58.63 61.23496995 2.60496995 42
3 168.5 56.81 66.22448602 9.41448602 51
4 170.1875 59.42 64.41011654 4.99011654 37
5 181.875 87.09 92.07925111 4.98925111 42
smkintensity82_
Obs smokeintensity 71 smokeyrs asthma bronch
1 30 -10 29 0 0
2 20 -10 24 0 0
3 20 -14 26 0 0
4 3 4 53 0 0
5 20 0 19 0 0
The SAS System 28
20:39 Thursday, December 15, 2022
Obs tb hf hbp pepticulcer colitis
1 0 0 1 1 0
2 0 0 0 0 0
3 0 0 0 0 0
4 0 0 1 0 0
5 0 0 0 0 0
Obs hepatitis chroniccough hayfever diabetes polio
1 0 0 0 1 0
2 0 0 0 0 0
3 0 0 1 0 0
4 0 0 0 0 0
5 0 0 0 0 0
Obs tumor nervousbreak alcoholpy alcoholfreq alcoholtype
1 0 0 1 1 3
2 0 0 1 0 1
3 1 0 1 3 4
4 0 0 1 2 3
5 0 0 1 2 1
Obs alcoholhowmuch pica headache otherpain weakheart
1 7 0 1 0 0
2 4 0 1 0 0
3 . 0 1 1 0
4 4 0 0 1 1
5 2 0 1 0 0
Obs allergies nerves lackpep hbpmed boweltrouble
1 0 0 0 1 0
2 0 0 0 0 0
3 0 1 0 0 0
4 0 0 0 0 0
5 0 0 0 0 1
The SAS System 29
20:39 Thursday, December 15, 2022
Obs wtloss infection active exercise birthcontrol
1 0 0 0 2 2
2 0 1 0 0 2
3 0 0 0 2 0
4 0 0 1 2 2
5 0 0 1 1 2
Obs pregnancies cholesterol hightax82 price71 price82
1 . 197 0 2.18359375 1.7399902344
2 . 301 0 2.3466796875 1.7973632813
3 2 157 0 1.5695800781 1.5134277344
4 . 174 0 1.5065917969 1.4519042969
5 . 216 0 2.3466796875 1.7973632813
Obs tax71 tax82 price71_82 tax71_82
1 1.1022949219 0.4619750977 0.4437866211 0.6403808594
2 1.3649902344 0.5718994141 0.5493164063 0.79296875
3 0.5512695313 0.2309875488 0.0561981201 0.3202514648
4 0.5249023438 0.2199707031 0.0547943115 0.3049926758
5 1.3649902344 0.5718994141 0.5493164063 0.79296875
The SAS System 30
20:39 Thursday, December 15, 2022
The MEANS Procedure
N
Variable Miss
-------------------------
seqn 0
qsmk 0
death 0
yrdth 1311
modth 1307
dadth 1307
sbp 77
dbp 81
sex 0
age 0
race 0
income 62
marital 0
school 0
education 0
ht 0
wt71 0
wt82 63
wt82_71 63
birthplace 92
smokeintensity 0
smkintensity82_71 0
smokeyrs 0
asthma 0
bronch 0
tb 0
hf 0
hbp 0
pepticulcer 0
colitis 0
hepatitis 0
chroniccough 0
hayfever 0
diabetes 0
polio 0
tumor 0
nervousbreak 0
alcoholpy 0
alcoholfreq 0
alcoholtype 0
alcoholhowmuch 417
pica 0
headache 0
otherpain 0
weakheart 0
allergies 0
nerves 0
lackpep 0
hbpmed 0
boweltrouble 0
wtloss 0
-------------------------
The SAS System 31
20:39 Thursday, December 15, 2022
The MEANS Procedure
N
Variable Miss
-------------------------
infection 0
active 0
exercise 0
birthcontrol 0
pregnancies 903
cholesterol 16
hightax82 92
price71 92
price82 92
tax71 92
tax82 92
price71_82 92
tax71_82 92
-------------------------
The SAS System 32
20:39 Thursday, December 15, 2022
Obs Variable NMiss
1 seqn 0
2 qsmk 0
3 death 0
4 yrdth 1311
5 modth 1307
6 dadth 1307
7 sbp 77
8 dbp 81
9 sex 0
10 age 0
11 race 0
12 income 62
13 marital 0
14 school 0
15 education 0
16 ht 0
17 wt71 0
18 wt82 63
19 wt82_71 63
20 birthplace 92
21 smokeintensity 0
22 smkintensity82_71 0
23 smokeyrs 0
24 asthma 0
25 bronch 0
26 tb 0
27 hf 0
28 hbp 0
29 pepticulcer 0
30 colitis 0
31 hepatitis 0
32 chroniccough 0
33 hayfever 0
34 diabetes 0
35 polio 0
36 tumor 0
37 nervousbreak 0
38 alcoholpy 0
39 alcoholfreq 0
40 alcoholtype 0
41 alcoholhowmuch 417
42 pica 0
43 headache 0
44 otherpain 0
45 weakheart 0
46 allergies 0
47 nerves 0
48 lackpep 0
49 hbpmed 0
50 boweltrouble 0
51 wtloss 0
52 infection 0
53 active 0
54 exercise 0
55 birthcontrol 0
The SAS System 33
20:39 Thursday, December 15, 2022
Obs Variable NMiss
56 pregnancies 903
57 cholesterol 16
58 hightax82 92
59 price71 92
60 price82 92
61 tax71 92
62 tax82 92
63 price71_82 92
64 tax71_82 92
The SAS System 34
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS2 Observations 44
Member Type DATA Variables 64
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 512
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 1
First Data Page 1
Max Obs per Page 127
Obs in First Data Page 44
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs2.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998379
Access Permission rw-rw-r--
Owner Name jrgant
File Size 128KB
File Size (bytes) 131072
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
53 active Num 8 BEST12. BEST32.
10 age Num 8 BEST12. BEST32.
39 alcoholfreq Num 8 BEST12. BEST32.
41 alcoholhowmuch Num 8 BEST12. BEST32.
38 alcoholpy Num 8 BEST12. BEST32.
40 alcoholtype Num 8 BEST12. BEST32.
46 allergies Num 8 BEST12. BEST32.
24 asthma Num 8 BEST12. BEST32.
55 birthcontrol Num 8 BEST12. BEST32.
20 birthplace Num 8 BEST12. BEST32.
50 boweltrouble Num 8 BEST12. BEST32.
25 bronch Num 8 BEST12. BEST32.
57 cholesterol Num 8 BEST12. BEST32.
32 chroniccough Num 8 BEST12. BEST32.
30 colitis Num 8 BEST12. BEST32.
6 dadth Num 8 BEST12. BEST32.
8 dbp Num 8 BEST12. BEST32.
3 death Num 8 BEST12. BEST32.
The SAS System 35
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
34 diabetes Num 8 BEST12. BEST32.
15 education Num 8 BEST12. BEST32.
54 exercise Num 8 BEST12. BEST32.
33 hayfever Num 8 BEST12. BEST32.
28 hbp Num 8 BEST12. BEST32.
49 hbpmed Num 8 BEST12. BEST32.
43 headache Num 8 BEST12. BEST32.
31 hepatitis Num 8 BEST12. BEST32.
27 hf Num 8 BEST12. BEST32.
58 hightax82 Num 8 BEST12. BEST32.
16 ht Num 8 BEST12. BEST32.
12 income Num 8 BEST12. BEST32.
52 infection Num 8 BEST12. BEST32.
48 lackpep Num 8 BEST12. BEST32.
13 marital Num 8 BEST12. BEST32.
5 modth Num 8 BEST12. BEST32.
47 nerves Num 8 BEST12. BEST32.
37 nervousbreak Num 8 BEST12. BEST32.
44 otherpain Num 8 BEST12. BEST32.
29 pepticulcer Num 8 BEST12. BEST32.
42 pica Num 8 BEST12. BEST32.
35 polio Num 8 BEST12. BEST32.
56 pregnancies Num 8 BEST12. BEST32.
59 price71 Num 8 BEST12. BEST32.
60 price82 Num 8 BEST12. BEST32.
63 price71_82 Num 8 BEST12. BEST32.
2 qsmk Num 8 BEST12. BEST32.
11 race Num 8 BEST12. BEST32.
7 sbp Num 8 BEST12. BEST32.
14 school Num 8 BEST12. BEST32.
1 seqn Num 8 BEST12. BEST32.
9 sex Num 8 BEST12. BEST32.
22 smkintensity82_71 Num 8 BEST12. BEST32.
21 smokeintensity Num 8 BEST12. BEST32.
23 smokeyrs Num 8 BEST12. BEST32.
61 tax71 Num 8 BEST12. BEST32.
62 tax82 Num 8 BEST12. BEST32.
64 tax71_82 Num 8 BEST12. BEST32.
26 tb Num 8 BEST12. BEST32.
36 tumor Num 8 BEST12. BEST32.
45 weakheart Num 8 BEST12. BEST32.
17 wt71 Num 8 BEST12. BEST32.
18 wt82 Num 8 BEST12. BEST32.
19 wt82_71 Num 8 BEST12. BEST32.
51 wtloss Num 8 BEST12. BEST32.
4 yrdth Num 8 BEST12. BEST32.
The SAS System 36
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS3 Observations 1552
Member Type DATA Variables 8
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 64
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 2
First Data Page 1
Max Obs per Page 1021
Obs in First Data Page 977
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs3.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998380
Access Permission rw-rw-r--
Owner Name jrgant
File Size 192KB
File Size (bytes) 196608
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
2 age Num 8 BEST12. BEST32.
6 alcoholfreq Num 8 BEST12. BEST32.
8 allergies Num 8 BEST12. BEST32.
5 asthma Num 8 BEST12. BEST32.
1 sbp Num 8 BEST12. BEST32.
4 smokeintensity Num 8 BEST12. BEST32.
7 weakheart Num 8 BEST12. BEST32.
3 wt71 Num 8 BEST12. BEST32.
The SAS System 37
20:39 Thursday, December 15, 2022
The FREQ Procedure
Table of alcfreqcat by alcoholfreq
alcfreqcat alcoholfreq
Frequency|
Percent |
Row Pct |
Col Pct | 0| 1| 2| 3| 4| 5| Total
---------+--------+--------+--------+--------+--------+--------+
. | 0 | 0 | 0 | 0 | 0 | 5 | 5
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.32 | 0.32
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 100.00 |
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 100.00 |
---------+--------+--------+--------+--------+--------+--------+
0 | 320 | 0 | 0 | 0 | 0 | 0 | 320
| 20.62 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 20.62
| 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
1 | 0 | 217 | 0 | 0 | 0 | 0 | 217
| 0.00 | 13.98 | 0.00 | 0.00 | 0.00 | 0.00 | 13.98
| 0.00 | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| 0.00 | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
2 | 0 | 0 | 489 | 0 | 0 | 0 | 489
| 0.00 | 0.00 | 31.51 | 0.00 | 0.00 | 0.00 | 31.51
| 0.00 | 0.00 | 100.00 | 0.00 | 0.00 | 0.00 |
| 0.00 | 0.00 | 100.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
3 | 0 | 0 | 0 | 329 | 0 | 0 | 329
| 0.00 | 0.00 | 0.00 | 21.20 | 0.00 | 0.00 | 21.20
| 0.00 | 0.00 | 0.00 | 100.00 | 0.00 | 0.00 |
| 0.00 | 0.00 | 0.00 | 100.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
4 | 0 | 0 | 0 | 0 | 192 | 0 | 192
| 0.00 | 0.00 | 0.00 | 0.00 | 12.37 | 0.00 | 12.37
| 0.00 | 0.00 | 0.00 | 0.00 | 100.00 | 0.00 |
| 0.00 | 0.00 | 0.00 | 0.00 | 100.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
Total 320 217 489 329 192 5 1552
20.62 13.98 31.51 21.20 12.37 0.32 100.00
The SAS System 38
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS3 Observations 1552
Member Type DATA Variables 9
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 72
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 2
First Data Page 1
Max Obs per Page 908
Obs in First Data Page 866
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs3.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998382
Access Permission rw-rw-r--
Owner Name jrgant
File Size 192KB
File Size (bytes) 196608
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
2 age Num 8 BEST12. BEST32.
9 alcfreqcat Char 1
6 alcoholfreq Num 8 BEST12. BEST32.
8 allergies Num 8 BEST12. BEST32.
5 asthma Num 8 BEST12. BEST32.
1 sbp Num 8 BEST12. BEST32.
4 smokeintensity Num 8 BEST12. BEST32.
7 weakheart Num 8 BEST12. BEST32.
3 wt71 Num 8 BEST12. BEST32.
The SAS System 39
20:39 Thursday, December 15, 2022
Obs sbp age wt71 smokeintensity
1 175 42 79.04 30
2 123 36 58.63 20
3 115 56 56.81 20
4 148 68 59.42 3
5 118 40 87.09 20
Obs asthma weakheart allergies alcfreqcat
1 0 0 0 1
2 0 0 0 0
3 0 0 0 3
4 0 1 0 2
5 0 0 0 2
The SAS System 40
20:39 Thursday, December 15, 2022
The MEANS Procedure
Variable N Mean Std Dev Minimum
----------------------------------------------------------------------
age 1547 43.6528765 12.0298947 25.0000000
wt71 1547 70.9031157 15.3891998 39.5800000
smokeintensity 1547 20.5416936 11.7258480 1.0000000
sbp 1547 128.7039431 19.0608817 87.0000000
----------------------------------------------------------------------
Variable Maximum
------------------------------
age 74.0000000
wt71 151.7300000
smokeintensity 80.0000000
sbp 229.0000000
------------------------------
The SAS System 41
20:39 Thursday, December 15, 2022
The FREQ Procedure
Cumulative Cumulative
asthma Frequency Percent Frequency Percent
-----------------------------------------------------------
0 1474 95.28 1474 95.28
1 73 4.72 1547 100.00
Cumulative Cumulative
allergies Frequency Percent Frequency Percent
--------------------------------------------------------------
0 1448 93.60 1448 93.60
1 99 6.40 1547 100.00
Cumulative Cumulative
alcfreqcat Frequency Percent Frequency Percent
---------------------------------------------------------------
0 320 20.69 320 20.69
1 217 14.03 537 34.71
2 489 31.61 1026 66.32
3 329 21.27 1355 87.59
4 192 12.41 1547 100.00
Cumulative Cumulative
weakheart Frequency Percent Frequency Percent
--------------------------------------------------------------
0 1512 97.74 1512 97.74
1 35 2.26 1547 100.00
The SAS System 42
20:39 Thursday, December 15, 2022
The FREQ Procedure
Cumulative Cumulative
sbp_hi Frequency Percent Frequency Percent
-----------------------------------------------------------
0 1192 76.80 1192 76.80
1 360 23.20 1552 100.00
Frequency Missing = 77
The SAS System 43
20:39 Thursday, December 15, 2022
The FREQ Procedure
Table of sbp_hi by qsmk
sbp_hi qsmk
Frequency|
Percent |
Row Pct |
Col Pct | 0| 1| Total
---------+--------+--------+
0 | 908 | 284 | 1192
| 58.51 | 18.30 | 76.80
| 76.17 | 23.83 |
| 78.34 | 72.26 |
---------+--------+--------+
1 | 251 | 109 | 360
| 16.17 | 7.02 | 23.20
| 69.72 | 30.28 |
| 21.66 | 27.74 |
---------+--------+--------+
Total 1159 393 1552
74.68 25.32 100.00
Frequency Missing = 77
Statistics for Table of sbp_hi by qsmk
Statistic DF Value Prob
------------------------------------------------------
Chi-Square 1 6.0872 0.0136
Likelihood Ratio Chi-Square 1 5.9256 0.0149
Continuity Adj. Chi-Square 1 5.7508 0.0165
Mantel-Haenszel Chi-Square 1 6.0833 0.0136
Phi Coefficient 0.0626
Contingency Coefficient 0.0625
Cramer's V 0.0626
Fisher's Exact Test
----------------------------------
Cell (1,1) Frequency (F) 908
Left-sided Pr <= F 0.9939
Right-sided Pr >= F 0.0088
Table Probability (P) 0.0028
Two-sided Pr <= P 0.0155
Sample Size = 1552
Frequency Missing = 77
The SAS System 44
20:39 Thursday, December 15, 2022
The REG Procedure
Model: MODEL1
Dependent Variable: sbp
Number of Observations Read 1629
Number of Observations Used 1552
Number of Observations with Missing Values 77
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 4673.90689 4673.90689 12.98 0.0003
Error 1550 558280 360.18067
Corrected Total 1551 562954
Root MSE 18.97843 R-Square 0.0083
Dependent Mean 128.70941 Adj R-Sq 0.0077
Coeff Var 14.74517
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 127.69888 0.55747 229.07 <.0001
qsmk 1 3.99069 1.10782 3.60 0.0003
Parameter Estimates
Variable DF 95% Confidence Limits
Intercept 1 126.60541 128.79235
qsmk 1 1.81771 6.16367
The SAS System 45
20:39 Thursday, December 15, 2022
Obs Sepal_Length Sepal_Width Petal_Length Petal_Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
The SAS System 46
20:39 Thursday, December 15, 2022
Obs Sepal_Length Sepal_Width Petal_Length Petal_Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
7 4.6 3.4 1.4 0.3 setosa
8 5 3.4 1.5 0.2 setosa
9 4.4 2.9 1.4 0.2 setosa
10 4.9 3.1 1.5 0.1 setosa
The SAS System 47
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS Observations 1629
Member Type DATA Variables 64
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 512
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 13
First Data Page 1
Max Obs per Page 127
Obs in First Data Page 107
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998378
Access Permission rw-rw-r--
Owner Name jrgant
File Size 896KB
File Size (bytes) 917504
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
53 active Num 8 BEST12. BEST32.
10 age Num 8 BEST12. BEST32.
39 alcoholfreq Num 8 BEST12. BEST32.
41 alcoholhowmuch Num 8 BEST12. BEST32.
38 alcoholpy Num 8 BEST12. BEST32.
40 alcoholtype Num 8 BEST12. BEST32.
46 allergies Num 8 BEST12. BEST32.
24 asthma Num 8 BEST12. BEST32.
55 birthcontrol Num 8 BEST12. BEST32.
20 birthplace Num 8 BEST12. BEST32.
50 boweltrouble Num 8 BEST12. BEST32.
25 bronch Num 8 BEST12. BEST32.
57 cholesterol Num 8 BEST12. BEST32.
32 chroniccough Num 8 BEST12. BEST32.
30 colitis Num 8 BEST12. BEST32.
6 dadth Num 8 BEST12. BEST32.
8 dbp Num 8 BEST12. BEST32.
3 death Num 8 BEST12. BEST32.
The SAS System 48
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
34 diabetes Num 8 BEST12. BEST32.
15 education Num 8 BEST12. BEST32.
54 exercise Num 8 BEST12. BEST32.
33 hayfever Num 8 BEST12. BEST32.
28 hbp Num 8 BEST12. BEST32.
49 hbpmed Num 8 BEST12. BEST32.
43 headache Num 8 BEST12. BEST32.
31 hepatitis Num 8 BEST12. BEST32.
27 hf Num 8 BEST12. BEST32.
58 hightax82 Num 8 BEST12. BEST32.
16 ht Num 8 BEST12. BEST32.
12 income Num 8 BEST12. BEST32.
52 infection Num 8 BEST12. BEST32.
48 lackpep Num 8 BEST12. BEST32.
13 marital Num 8 BEST12. BEST32.
5 modth Num 8 BEST12. BEST32.
47 nerves Num 8 BEST12. BEST32.
37 nervousbreak Num 8 BEST12. BEST32.
44 otherpain Num 8 BEST12. BEST32.
29 pepticulcer Num 8 BEST12. BEST32.
42 pica Num 8 BEST12. BEST32.
35 polio Num 8 BEST12. BEST32.
56 pregnancies Num 8 BEST12. BEST32.
59 price71 Num 8 BEST12. BEST32.
60 price82 Num 8 BEST12. BEST32.
63 price71_82 Num 8 BEST12. BEST32.
2 qsmk Num 8 BEST12. BEST32.
11 race Num 8 BEST12. BEST32.
7 sbp Num 8 BEST12. BEST32.
14 school Num 8 BEST12. BEST32.
1 seqn Num 8 BEST12. BEST32.
9 sex Num 8 BEST12. BEST32.
22 smkintensity82_71 Num 8 BEST12. BEST32.
21 smokeintensity Num 8 BEST12. BEST32.
23 smokeyrs Num 8 BEST12. BEST32.
61 tax71 Num 8 BEST12. BEST32.
62 tax82 Num 8 BEST12. BEST32.
64 tax71_82 Num 8 BEST12. BEST32.
26 tb Num 8 BEST12. BEST32.
36 tumor Num 8 BEST12. BEST32.
45 weakheart Num 8 BEST12. BEST32.
17 wt71 Num 8 BEST12. BEST32.
18 wt82 Num 8 BEST12. BEST32.
19 wt82_71 Num 8 BEST12. BEST32.
51 wtloss Num 8 BEST12. BEST32.
4 yrdth Num 8 BEST12. BEST32.
The SAS System 49
20:39 Thursday, December 15, 2022
Obs seqn qsmk death yrdth modth
1 233 0 0 . .
2 235 0 0 . .
3 244 0 0 . .
4 245 0 1 85 2
5 252 0 0 . .
Obs dadth sbp dbp sex age
1 . 175 96 0 42
2 . 123 80 0 36
3 . 115 75 1 56
4 14 148 78 0 68
5 . 118 77 0 40
Obs race income marital school education
1 1 19 2 7 1
2 0 18 2 9 2
3 1 15 3 11 2
4 1 15 3 5 1
5 0 18 2 11 2
Obs ht wt71 wt82 wt82_71 birthplace
1 174.1875 79.04 68.94604024 -10.09395976 47
2 159.375 58.63 61.23496995 2.60496995 42
3 168.5 56.81 66.22448602 9.41448602 51
4 170.1875 59.42 64.41011654 4.99011654 37
5 181.875 87.09 92.07925111 4.98925111 42
smkintensity82_
Obs smokeintensity 71 smokeyrs asthma bronch
1 30 -10 29 0 0
2 20 -10 24 0 0
3 20 -14 26 0 0
4 3 4 53 0 0
5 20 0 19 0 0
The SAS System 50
20:39 Thursday, December 15, 2022
Obs tb hf hbp pepticulcer colitis
1 0 0 1 1 0
2 0 0 0 0 0
3 0 0 0 0 0
4 0 0 1 0 0
5 0 0 0 0 0
Obs hepatitis chroniccough hayfever diabetes polio
1 0 0 0 1 0
2 0 0 0 0 0
3 0 0 1 0 0
4 0 0 0 0 0
5 0 0 0 0 0
Obs tumor nervousbreak alcoholpy alcoholfreq alcoholtype
1 0 0 1 1 3
2 0 0 1 0 1
3 1 0 1 3 4
4 0 0 1 2 3
5 0 0 1 2 1
Obs alcoholhowmuch pica headache otherpain weakheart
1 7 0 1 0 0
2 4 0 1 0 0
3 . 0 1 1 0
4 4 0 0 1 1
5 2 0 1 0 0
Obs allergies nerves lackpep hbpmed boweltrouble
1 0 0 0 1 0
2 0 0 0 0 0
3 0 1 0 0 0
4 0 0 0 0 0
5 0 0 0 0 1
The SAS System 51
20:39 Thursday, December 15, 2022
Obs wtloss infection active exercise birthcontrol
1 0 0 0 2 2
2 0 1 0 0 2
3 0 0 0 2 0
4 0 0 1 2 2
5 0 0 1 1 2
Obs pregnancies cholesterol hightax82 price71 price82
1 . 197 0 2.18359375 1.7399902344
2 . 301 0 2.3466796875 1.7973632813
3 2 157 0 1.5695800781 1.5134277344
4 . 174 0 1.5065917969 1.4519042969
5 . 216 0 2.3466796875 1.7973632813
Obs tax71 tax82 price71_82 tax71_82
1 1.1022949219 0.4619750977 0.4437866211 0.6403808594
2 1.3649902344 0.5718994141 0.5493164063 0.79296875
3 0.5512695313 0.2309875488 0.0561981201 0.3202514648
4 0.5249023438 0.2199707031 0.0547943115 0.3049926758
5 1.3649902344 0.5718994141 0.5493164063 0.79296875
The SAS System 52
20:39 Thursday, December 15, 2022
The MEANS Procedure
N
Variable Miss
-------------------------
seqn 0
qsmk 0
death 0
yrdth 1311
modth 1307
dadth 1307
sbp 77
dbp 81
sex 0
age 0
race 0
income 62
marital 0
school 0
education 0
ht 0
wt71 0
wt82 63
wt82_71 63
birthplace 92
smokeintensity 0
smkintensity82_71 0
smokeyrs 0
asthma 0
bronch 0
tb 0
hf 0
hbp 0
pepticulcer 0
colitis 0
hepatitis 0
chroniccough 0
hayfever 0
diabetes 0
polio 0
tumor 0
nervousbreak 0
alcoholpy 0
alcoholfreq 0
alcoholtype 0
alcoholhowmuch 417
pica 0
headache 0
otherpain 0
weakheart 0
allergies 0
nerves 0
lackpep 0
hbpmed 0
boweltrouble 0
wtloss 0
-------------------------
The SAS System 53
20:39 Thursday, December 15, 2022
The MEANS Procedure
N
Variable Miss
-------------------------
infection 0
active 0
exercise 0
birthcontrol 0
pregnancies 903
cholesterol 16
hightax82 92
price71 92
price82 92
tax71 92
tax82 92
price71_82 92
tax71_82 92
-------------------------
The SAS System 54
20:39 Thursday, December 15, 2022
Obs Variable NMiss
1 seqn 0
2 qsmk 0
3 death 0
4 yrdth 1311
5 modth 1307
6 dadth 1307
7 sbp 77
8 dbp 81
9 sex 0
10 age 0
11 race 0
12 income 62
13 marital 0
14 school 0
15 education 0
16 ht 0
17 wt71 0
18 wt82 63
19 wt82_71 63
20 birthplace 92
21 smokeintensity 0
22 smkintensity82_71 0
23 smokeyrs 0
24 asthma 0
25 bronch 0
26 tb 0
27 hf 0
28 hbp 0
29 pepticulcer 0
30 colitis 0
31 hepatitis 0
32 chroniccough 0
33 hayfever 0
34 diabetes 0
35 polio 0
36 tumor 0
37 nervousbreak 0
38 alcoholpy 0
39 alcoholfreq 0
40 alcoholtype 0
41 alcoholhowmuch 417
42 pica 0
43 headache 0
44 otherpain 0
45 weakheart 0
46 allergies 0
47 nerves 0
48 lackpep 0
49 hbpmed 0
50 boweltrouble 0
51 wtloss 0
52 infection 0
53 active 0
54 exercise 0
55 birthcontrol 0
The SAS System 55
20:39 Thursday, December 15, 2022
Obs Variable NMiss
56 pregnancies 903
57 cholesterol 16
58 hightax82 92
59 price71 92
60 price82 92
61 tax71 92
62 tax82 92
63 price71_82 92
64 tax71_82 92
The SAS System 56
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS2 Observations 44
Member Type DATA Variables 64
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 512
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 1
First Data Page 1
Max Obs per Page 127
Obs in First Data Page 44
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs2.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998383
Access Permission rw-rw-r--
Owner Name jrgant
File Size 128KB
File Size (bytes) 131072
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
53 active Num 8 BEST12. BEST32.
10 age Num 8 BEST12. BEST32.
39 alcoholfreq Num 8 BEST12. BEST32.
41 alcoholhowmuch Num 8 BEST12. BEST32.
38 alcoholpy Num 8 BEST12. BEST32.
40 alcoholtype Num 8 BEST12. BEST32.
46 allergies Num 8 BEST12. BEST32.
24 asthma Num 8 BEST12. BEST32.
55 birthcontrol Num 8 BEST12. BEST32.
20 birthplace Num 8 BEST12. BEST32.
50 boweltrouble Num 8 BEST12. BEST32.
25 bronch Num 8 BEST12. BEST32.
57 cholesterol Num 8 BEST12. BEST32.
32 chroniccough Num 8 BEST12. BEST32.
30 colitis Num 8 BEST12. BEST32.
6 dadth Num 8 BEST12. BEST32.
8 dbp Num 8 BEST12. BEST32.
3 death Num 8 BEST12. BEST32.
The SAS System 57
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
34 diabetes Num 8 BEST12. BEST32.
15 education Num 8 BEST12. BEST32.
54 exercise Num 8 BEST12. BEST32.
33 hayfever Num 8 BEST12. BEST32.
28 hbp Num 8 BEST12. BEST32.
49 hbpmed Num 8 BEST12. BEST32.
43 headache Num 8 BEST12. BEST32.
31 hepatitis Num 8 BEST12. BEST32.
27 hf Num 8 BEST12. BEST32.
58 hightax82 Num 8 BEST12. BEST32.
16 ht Num 8 BEST12. BEST32.
12 income Num 8 BEST12. BEST32.
52 infection Num 8 BEST12. BEST32.
48 lackpep Num 8 BEST12. BEST32.
13 marital Num 8 BEST12. BEST32.
5 modth Num 8 BEST12. BEST32.
47 nerves Num 8 BEST12. BEST32.
37 nervousbreak Num 8 BEST12. BEST32.
44 otherpain Num 8 BEST12. BEST32.
29 pepticulcer Num 8 BEST12. BEST32.
42 pica Num 8 BEST12. BEST32.
35 polio Num 8 BEST12. BEST32.
56 pregnancies Num 8 BEST12. BEST32.
59 price71 Num 8 BEST12. BEST32.
60 price82 Num 8 BEST12. BEST32.
63 price71_82 Num 8 BEST12. BEST32.
2 qsmk Num 8 BEST12. BEST32.
11 race Num 8 BEST12. BEST32.
7 sbp Num 8 BEST12. BEST32.
14 school Num 8 BEST12. BEST32.
1 seqn Num 8 BEST12. BEST32.
9 sex Num 8 BEST12. BEST32.
22 smkintensity82_71 Num 8 BEST12. BEST32.
21 smokeintensity Num 8 BEST12. BEST32.
23 smokeyrs Num 8 BEST12. BEST32.
61 tax71 Num 8 BEST12. BEST32.
62 tax82 Num 8 BEST12. BEST32.
64 tax71_82 Num 8 BEST12. BEST32.
26 tb Num 8 BEST12. BEST32.
36 tumor Num 8 BEST12. BEST32.
45 weakheart Num 8 BEST12. BEST32.
17 wt71 Num 8 BEST12. BEST32.
18 wt82 Num 8 BEST12. BEST32.
19 wt82_71 Num 8 BEST12. BEST32.
51 wtloss Num 8 BEST12. BEST32.
4 yrdth Num 8 BEST12. BEST32.
The SAS System 58
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS3 Observations 1552
Member Type DATA Variables 8
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 64
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 2
First Data Page 1
Max Obs per Page 1021
Obs in First Data Page 977
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs3.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998379
Access Permission rw-rw-r--
Owner Name jrgant
File Size 192KB
File Size (bytes) 196608
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
2 age Num 8 BEST12. BEST32.
6 alcoholfreq Num 8 BEST12. BEST32.
8 allergies Num 8 BEST12. BEST32.
5 asthma Num 8 BEST12. BEST32.
1 sbp Num 8 BEST12. BEST32.
4 smokeintensity Num 8 BEST12. BEST32.
7 weakheart Num 8 BEST12. BEST32.
3 wt71 Num 8 BEST12. BEST32.
The SAS System 59
20:39 Thursday, December 15, 2022
The FREQ Procedure
Table of alcfreqcat by alcoholfreq
alcfreqcat alcoholfreq
Frequency|
Percent |
Row Pct |
Col Pct | 0| 1| 2| 3| 4| 5| Total
---------+--------+--------+--------+--------+--------+--------+
. | 0 | 0 | 0 | 0 | 0 | 5 | 5
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.32 | 0.32
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 100.00 |
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 100.00 |
---------+--------+--------+--------+--------+--------+--------+
0 | 320 | 0 | 0 | 0 | 0 | 0 | 320
| 20.62 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 20.62
| 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
1 | 0 | 217 | 0 | 0 | 0 | 0 | 217
| 0.00 | 13.98 | 0.00 | 0.00 | 0.00 | 0.00 | 13.98
| 0.00 | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| 0.00 | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
2 | 0 | 0 | 489 | 0 | 0 | 0 | 489
| 0.00 | 0.00 | 31.51 | 0.00 | 0.00 | 0.00 | 31.51
| 0.00 | 0.00 | 100.00 | 0.00 | 0.00 | 0.00 |
| 0.00 | 0.00 | 100.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
3 | 0 | 0 | 0 | 329 | 0 | 0 | 329
| 0.00 | 0.00 | 0.00 | 21.20 | 0.00 | 0.00 | 21.20
| 0.00 | 0.00 | 0.00 | 100.00 | 0.00 | 0.00 |
| 0.00 | 0.00 | 0.00 | 100.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
4 | 0 | 0 | 0 | 0 | 192 | 0 | 192
| 0.00 | 0.00 | 0.00 | 0.00 | 12.37 | 0.00 | 12.37
| 0.00 | 0.00 | 0.00 | 0.00 | 100.00 | 0.00 |
| 0.00 | 0.00 | 0.00 | 0.00 | 100.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
Total 320 217 489 329 192 5 1552
20.62 13.98 31.51 21.20 12.37 0.32 100.00
The SAS System 60
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS3 Observations 1552
Member Type DATA Variables 9
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 72
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 2
First Data Page 1
Max Obs per Page 908
Obs in First Data Page 866
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs3.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998382
Access Permission rw-rw-r--
Owner Name jrgant
File Size 192KB
File Size (bytes) 196608
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
2 age Num 8 BEST12. BEST32.
9 alcfreqcat Char 1
6 alcoholfreq Num 8 BEST12. BEST32.
8 allergies Num 8 BEST12. BEST32.
5 asthma Num 8 BEST12. BEST32.
1 sbp Num 8 BEST12. BEST32.
4 smokeintensity Num 8 BEST12. BEST32.
7 weakheart Num 8 BEST12. BEST32.
3 wt71 Num 8 BEST12. BEST32.
The SAS System 61
20:39 Thursday, December 15, 2022
Obs sbp age wt71 smokeintensity
1 175 42 79.04 30
2 123 36 58.63 20
3 115 56 56.81 20
4 148 68 59.42 3
5 118 40 87.09 20
Obs asthma weakheart allergies alcfreqcat
1 0 0 0 1
2 0 0 0 0
3 0 0 0 3
4 0 1 0 2
5 0 0 0 2
The SAS System 62
20:39 Thursday, December 15, 2022
The MEANS Procedure
Variable N Mean Std Dev Minimum
----------------------------------------------------------------------
age 1547 43.6528765 12.0298947 25.0000000
wt71 1547 70.9031157 15.3891998 39.5800000
smokeintensity 1547 20.5416936 11.7258480 1.0000000
sbp 1547 128.7039431 19.0608817 87.0000000
----------------------------------------------------------------------
Variable Maximum
------------------------------
age 74.0000000
wt71 151.7300000
smokeintensity 80.0000000
sbp 229.0000000
------------------------------
The SAS System 63
20:39 Thursday, December 15, 2022
The FREQ Procedure
Cumulative Cumulative
asthma Frequency Percent Frequency Percent
-----------------------------------------------------------
0 1474 95.28 1474 95.28
1 73 4.72 1547 100.00
Cumulative Cumulative
allergies Frequency Percent Frequency Percent
--------------------------------------------------------------
0 1448 93.60 1448 93.60
1 99 6.40 1547 100.00
Cumulative Cumulative
alcfreqcat Frequency Percent Frequency Percent
---------------------------------------------------------------
0 320 20.69 320 20.69
1 217 14.03 537 34.71
2 489 31.61 1026 66.32
3 329 21.27 1355 87.59
4 192 12.41 1547 100.00
Cumulative Cumulative
weakheart Frequency Percent Frequency Percent
--------------------------------------------------------------
0 1512 97.74 1512 97.74
1 35 2.26 1547 100.00
The SAS System 64
20:39 Thursday, December 15, 2022
The FREQ Procedure
Cumulative Cumulative
sbp_hi Frequency Percent Frequency Percent
-----------------------------------------------------------
0 1192 76.80 1192 76.80
1 360 23.20 1552 100.00
Frequency Missing = 77
The SAS System 65
20:39 Thursday, December 15, 2022
The FREQ Procedure
Table of sbp_hi by qsmk
sbp_hi qsmk
Frequency|
Percent |
Row Pct |
Col Pct | 0| 1| Total
---------+--------+--------+
0 | 908 | 284 | 1192
| 58.51 | 18.30 | 76.80
| 76.17 | 23.83 |
| 78.34 | 72.26 |
---------+--------+--------+
1 | 251 | 109 | 360
| 16.17 | 7.02 | 23.20
| 69.72 | 30.28 |
| 21.66 | 27.74 |
---------+--------+--------+
Total 1159 393 1552
74.68 25.32 100.00
Frequency Missing = 77
Statistics for Table of sbp_hi by qsmk
Statistic DF Value Prob
------------------------------------------------------
Chi-Square 1 6.0872 0.0136
Likelihood Ratio Chi-Square 1 5.9256 0.0149
Continuity Adj. Chi-Square 1 5.7508 0.0165
Mantel-Haenszel Chi-Square 1 6.0833 0.0136
Phi Coefficient 0.0626
Contingency Coefficient 0.0625
Cramer's V 0.0626
Fisher's Exact Test
----------------------------------
Cell (1,1) Frequency (F) 908
Left-sided Pr <= F 0.9939
Right-sided Pr >= F 0.0088
Table Probability (P) 0.0028
Two-sided Pr <= P 0.0155
Sample Size = 1552
Frequency Missing = 77
The SAS System 66
20:39 Thursday, December 15, 2022
The REG Procedure
Model: MODEL1
Dependent Variable: sbp
Number of Observations Read 1629
Number of Observations Used 1552
Number of Observations with Missing Values 77
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 4673.90689 4673.90689 12.98 0.0003
Error 1550 558280 360.18067
Corrected Total 1551 562954
Root MSE 18.97843 R-Square 0.0083
Dependent Mean 128.70941 Adj R-Sq 0.0077
Coeff Var 14.74517
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 127.69888 0.55747 229.07 <.0001
qsmk 1 3.99069 1.10782 3.60 0.0003
Parameter Estimates
Variable DF 95% Confidence Limits
Intercept 1 126.60541 128.79235
qsmk 1 1.81771 6.16367
The SAS System 67
20:39 Thursday, December 15, 2022
Obs Sepal_Length Sepal_Width Petal_Length Petal_Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
The SAS System 68
20:39 Thursday, December 15, 2022
Obs Sepal_Length Sepal_Width Petal_Length Petal_Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
7 4.6 3.4 1.4 0.3 setosa
8 5 3.4 1.5 0.2 setosa
9 4.4 2.9 1.4 0.2 setosa
10 4.9 3.1 1.5 0.1 setosa
The SAS System 69
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS Observations 1629
Member Type DATA Variables 64
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 512
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 13
First Data Page 1
Max Obs per Page 127
Obs in First Data Page 107
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998378
Access Permission rw-rw-r--
Owner Name jrgant
File Size 896KB
File Size (bytes) 917504
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
53 active Num 8 BEST12. BEST32.
10 age Num 8 BEST12. BEST32.
39 alcoholfreq Num 8 BEST12. BEST32.
41 alcoholhowmuch Num 8 BEST12. BEST32.
38 alcoholpy Num 8 BEST12. BEST32.
40 alcoholtype Num 8 BEST12. BEST32.
46 allergies Num 8 BEST12. BEST32.
24 asthma Num 8 BEST12. BEST32.
55 birthcontrol Num 8 BEST12. BEST32.
20 birthplace Num 8 BEST12. BEST32.
50 boweltrouble Num 8 BEST12. BEST32.
25 bronch Num 8 BEST12. BEST32.
57 cholesterol Num 8 BEST12. BEST32.
32 chroniccough Num 8 BEST12. BEST32.
30 colitis Num 8 BEST12. BEST32.
6 dadth Num 8 BEST12. BEST32.
8 dbp Num 8 BEST12. BEST32.
3 death Num 8 BEST12. BEST32.
The SAS System 70
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
34 diabetes Num 8 BEST12. BEST32.
15 education Num 8 BEST12. BEST32.
54 exercise Num 8 BEST12. BEST32.
33 hayfever Num 8 BEST12. BEST32.
28 hbp Num 8 BEST12. BEST32.
49 hbpmed Num 8 BEST12. BEST32.
43 headache Num 8 BEST12. BEST32.
31 hepatitis Num 8 BEST12. BEST32.
27 hf Num 8 BEST12. BEST32.
58 hightax82 Num 8 BEST12. BEST32.
16 ht Num 8 BEST12. BEST32.
12 income Num 8 BEST12. BEST32.
52 infection Num 8 BEST12. BEST32.
48 lackpep Num 8 BEST12. BEST32.
13 marital Num 8 BEST12. BEST32.
5 modth Num 8 BEST12. BEST32.
47 nerves Num 8 BEST12. BEST32.
37 nervousbreak Num 8 BEST12. BEST32.
44 otherpain Num 8 BEST12. BEST32.
29 pepticulcer Num 8 BEST12. BEST32.
42 pica Num 8 BEST12. BEST32.
35 polio Num 8 BEST12. BEST32.
56 pregnancies Num 8 BEST12. BEST32.
59 price71 Num 8 BEST12. BEST32.
60 price82 Num 8 BEST12. BEST32.
63 price71_82 Num 8 BEST12. BEST32.
2 qsmk Num 8 BEST12. BEST32.
11 race Num 8 BEST12. BEST32.
7 sbp Num 8 BEST12. BEST32.
14 school Num 8 BEST12. BEST32.
1 seqn Num 8 BEST12. BEST32.
9 sex Num 8 BEST12. BEST32.
22 smkintensity82_71 Num 8 BEST12. BEST32.
21 smokeintensity Num 8 BEST12. BEST32.
23 smokeyrs Num 8 BEST12. BEST32.
61 tax71 Num 8 BEST12. BEST32.
62 tax82 Num 8 BEST12. BEST32.
64 tax71_82 Num 8 BEST12. BEST32.
26 tb Num 8 BEST12. BEST32.
36 tumor Num 8 BEST12. BEST32.
45 weakheart Num 8 BEST12. BEST32.
17 wt71 Num 8 BEST12. BEST32.
18 wt82 Num 8 BEST12. BEST32.
19 wt82_71 Num 8 BEST12. BEST32.
51 wtloss Num 8 BEST12. BEST32.
4 yrdth Num 8 BEST12. BEST32.
The SAS System 71
20:39 Thursday, December 15, 2022
Obs seqn qsmk death yrdth modth
1 233 0 0 . .
2 235 0 0 . .
3 244 0 0 . .
4 245 0 1 85 2
5 252 0 0 . .
Obs dadth sbp dbp sex age
1 . 175 96 0 42
2 . 123 80 0 36
3 . 115 75 1 56
4 14 148 78 0 68
5 . 118 77 0 40
Obs race income marital school education
1 1 19 2 7 1
2 0 18 2 9 2
3 1 15 3 11 2
4 1 15 3 5 1
5 0 18 2 11 2
Obs ht wt71 wt82 wt82_71 birthplace
1 174.1875 79.04 68.94604024 -10.09395976 47
2 159.375 58.63 61.23496995 2.60496995 42
3 168.5 56.81 66.22448602 9.41448602 51
4 170.1875 59.42 64.41011654 4.99011654 37
5 181.875 87.09 92.07925111 4.98925111 42
smkintensity82_
Obs smokeintensity 71 smokeyrs asthma bronch
1 30 -10 29 0 0
2 20 -10 24 0 0
3 20 -14 26 0 0
4 3 4 53 0 0
5 20 0 19 0 0
The SAS System 72
20:39 Thursday, December 15, 2022
Obs tb hf hbp pepticulcer colitis
1 0 0 1 1 0
2 0 0 0 0 0
3 0 0 0 0 0
4 0 0 1 0 0
5 0 0 0 0 0
Obs hepatitis chroniccough hayfever diabetes polio
1 0 0 0 1 0
2 0 0 0 0 0
3 0 0 1 0 0
4 0 0 0 0 0
5 0 0 0 0 0
Obs tumor nervousbreak alcoholpy alcoholfreq alcoholtype
1 0 0 1 1 3
2 0 0 1 0 1
3 1 0 1 3 4
4 0 0 1 2 3
5 0 0 1 2 1
Obs alcoholhowmuch pica headache otherpain weakheart
1 7 0 1 0 0
2 4 0 1 0 0
3 . 0 1 1 0
4 4 0 0 1 1
5 2 0 1 0 0
Obs allergies nerves lackpep hbpmed boweltrouble
1 0 0 0 1 0
2 0 0 0 0 0
3 0 1 0 0 0
4 0 0 0 0 0
5 0 0 0 0 1
The SAS System 73
20:39 Thursday, December 15, 2022
Obs wtloss infection active exercise birthcontrol
1 0 0 0 2 2
2 0 1 0 0 2
3 0 0 0 2 0
4 0 0 1 2 2
5 0 0 1 1 2
Obs pregnancies cholesterol hightax82 price71 price82
1 . 197 0 2.18359375 1.7399902344
2 . 301 0 2.3466796875 1.7973632813
3 2 157 0 1.5695800781 1.5134277344
4 . 174 0 1.5065917969 1.4519042969
5 . 216 0 2.3466796875 1.7973632813
Obs tax71 tax82 price71_82 tax71_82
1 1.1022949219 0.4619750977 0.4437866211 0.6403808594
2 1.3649902344 0.5718994141 0.5493164063 0.79296875
3 0.5512695313 0.2309875488 0.0561981201 0.3202514648
4 0.5249023438 0.2199707031 0.0547943115 0.3049926758
5 1.3649902344 0.5718994141 0.5493164063 0.79296875
The SAS System 74
20:39 Thursday, December 15, 2022
The MEANS Procedure
N
Variable Miss
-------------------------
seqn 0
qsmk 0
death 0
yrdth 1311
modth 1307
dadth 1307
sbp 77
dbp 81
sex 0
age 0
race 0
income 62
marital 0
school 0
education 0
ht 0
wt71 0
wt82 63
wt82_71 63
birthplace 92
smokeintensity 0
smkintensity82_71 0
smokeyrs 0
asthma 0
bronch 0
tb 0
hf 0
hbp 0
pepticulcer 0
colitis 0
hepatitis 0
chroniccough 0
hayfever 0
diabetes 0
polio 0
tumor 0
nervousbreak 0
alcoholpy 0
alcoholfreq 0
alcoholtype 0
alcoholhowmuch 417
pica 0
headache 0
otherpain 0
weakheart 0
allergies 0
nerves 0
lackpep 0
hbpmed 0
boweltrouble 0
wtloss 0
-------------------------
The SAS System 75
20:39 Thursday, December 15, 2022
The MEANS Procedure
N
Variable Miss
-------------------------
infection 0
active 0
exercise 0
birthcontrol 0
pregnancies 903
cholesterol 16
hightax82 92
price71 92
price82 92
tax71 92
tax82 92
price71_82 92
tax71_82 92
-------------------------
The SAS System 76
20:39 Thursday, December 15, 2022
Obs Variable NMiss
1 seqn 0
2 qsmk 0
3 death 0
4 yrdth 1311
5 modth 1307
6 dadth 1307
7 sbp 77
8 dbp 81
9 sex 0
10 age 0
11 race 0
12 income 62
13 marital 0
14 school 0
15 education 0
16 ht 0
17 wt71 0
18 wt82 63
19 wt82_71 63
20 birthplace 92
21 smokeintensity 0
22 smkintensity82_71 0
23 smokeyrs 0
24 asthma 0
25 bronch 0
26 tb 0
27 hf 0
28 hbp 0
29 pepticulcer 0
30 colitis 0
31 hepatitis 0
32 chroniccough 0
33 hayfever 0
34 diabetes 0
35 polio 0
36 tumor 0
37 nervousbreak 0
38 alcoholpy 0
39 alcoholfreq 0
40 alcoholtype 0
41 alcoholhowmuch 417
42 pica 0
43 headache 0
44 otherpain 0
45 weakheart 0
46 allergies 0
47 nerves 0
48 lackpep 0
49 hbpmed 0
50 boweltrouble 0
51 wtloss 0
52 infection 0
53 active 0
54 exercise 0
55 birthcontrol 0
The SAS System 77
20:39 Thursday, December 15, 2022
Obs Variable NMiss
56 pregnancies 903
57 cholesterol 16
58 hightax82 92
59 price71 92
60 price82 92
61 tax71 92
62 tax82 92
63 price71_82 92
64 tax71_82 92
The SAS System 78
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS2 Observations 44
Member Type DATA Variables 64
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 512
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 1
First Data Page 1
Max Obs per Page 127
Obs in First Data Page 44
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs2.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998381
Access Permission rw-rw-r--
Owner Name jrgant
File Size 128KB
File Size (bytes) 131072
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
53 active Num 8 BEST12. BEST32.
10 age Num 8 BEST12. BEST32.
39 alcoholfreq Num 8 BEST12. BEST32.
41 alcoholhowmuch Num 8 BEST12. BEST32.
38 alcoholpy Num 8 BEST12. BEST32.
40 alcoholtype Num 8 BEST12. BEST32.
46 allergies Num 8 BEST12. BEST32.
24 asthma Num 8 BEST12. BEST32.
55 birthcontrol Num 8 BEST12. BEST32.
20 birthplace Num 8 BEST12. BEST32.
50 boweltrouble Num 8 BEST12. BEST32.
25 bronch Num 8 BEST12. BEST32.
57 cholesterol Num 8 BEST12. BEST32.
32 chroniccough Num 8 BEST12. BEST32.
30 colitis Num 8 BEST12. BEST32.
6 dadth Num 8 BEST12. BEST32.
8 dbp Num 8 BEST12. BEST32.
3 death Num 8 BEST12. BEST32.
The SAS System 79
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
34 diabetes Num 8 BEST12. BEST32.
15 education Num 8 BEST12. BEST32.
54 exercise Num 8 BEST12. BEST32.
33 hayfever Num 8 BEST12. BEST32.
28 hbp Num 8 BEST12. BEST32.
49 hbpmed Num 8 BEST12. BEST32.
43 headache Num 8 BEST12. BEST32.
31 hepatitis Num 8 BEST12. BEST32.
27 hf Num 8 BEST12. BEST32.
58 hightax82 Num 8 BEST12. BEST32.
16 ht Num 8 BEST12. BEST32.
12 income Num 8 BEST12. BEST32.
52 infection Num 8 BEST12. BEST32.
48 lackpep Num 8 BEST12. BEST32.
13 marital Num 8 BEST12. BEST32.
5 modth Num 8 BEST12. BEST32.
47 nerves Num 8 BEST12. BEST32.
37 nervousbreak Num 8 BEST12. BEST32.
44 otherpain Num 8 BEST12. BEST32.
29 pepticulcer Num 8 BEST12. BEST32.
42 pica Num 8 BEST12. BEST32.
35 polio Num 8 BEST12. BEST32.
56 pregnancies Num 8 BEST12. BEST32.
59 price71 Num 8 BEST12. BEST32.
60 price82 Num 8 BEST12. BEST32.
63 price71_82 Num 8 BEST12. BEST32.
2 qsmk Num 8 BEST12. BEST32.
11 race Num 8 BEST12. BEST32.
7 sbp Num 8 BEST12. BEST32.
14 school Num 8 BEST12. BEST32.
1 seqn Num 8 BEST12. BEST32.
9 sex Num 8 BEST12. BEST32.
22 smkintensity82_71 Num 8 BEST12. BEST32.
21 smokeintensity Num 8 BEST12. BEST32.
23 smokeyrs Num 8 BEST12. BEST32.
61 tax71 Num 8 BEST12. BEST32.
62 tax82 Num 8 BEST12. BEST32.
64 tax71_82 Num 8 BEST12. BEST32.
26 tb Num 8 BEST12. BEST32.
36 tumor Num 8 BEST12. BEST32.
45 weakheart Num 8 BEST12. BEST32.
17 wt71 Num 8 BEST12. BEST32.
18 wt82 Num 8 BEST12. BEST32.
19 wt82_71 Num 8 BEST12. BEST32.
51 wtloss Num 8 BEST12. BEST32.
4 yrdth Num 8 BEST12. BEST32.
The SAS System 80
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS3 Observations 1552
Member Type DATA Variables 8
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 64
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 2
First Data Page 1
Max Obs per Page 1021
Obs in First Data Page 977
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs3.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998383
Access Permission rw-rw-r--
Owner Name jrgant
File Size 192KB
File Size (bytes) 196608
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
2 age Num 8 BEST12. BEST32.
6 alcoholfreq Num 8 BEST12. BEST32.
8 allergies Num 8 BEST12. BEST32.
5 asthma Num 8 BEST12. BEST32.
1 sbp Num 8 BEST12. BEST32.
4 smokeintensity Num 8 BEST12. BEST32.
7 weakheart Num 8 BEST12. BEST32.
3 wt71 Num 8 BEST12. BEST32.
The SAS System 81
20:39 Thursday, December 15, 2022
The FREQ Procedure
Table of alcfreqcat by alcoholfreq
alcfreqcat alcoholfreq
Frequency|
Percent |
Row Pct |
Col Pct | 0| 1| 2| 3| 4| 5| Total
---------+--------+--------+--------+--------+--------+--------+
. | 0 | 0 | 0 | 0 | 0 | 5 | 5
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.32 | 0.32
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 100.00 |
| 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 100.00 |
---------+--------+--------+--------+--------+--------+--------+
0 | 320 | 0 | 0 | 0 | 0 | 0 | 320
| 20.62 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 20.62
| 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
1 | 0 | 217 | 0 | 0 | 0 | 0 | 217
| 0.00 | 13.98 | 0.00 | 0.00 | 0.00 | 0.00 | 13.98
| 0.00 | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| 0.00 | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
2 | 0 | 0 | 489 | 0 | 0 | 0 | 489
| 0.00 | 0.00 | 31.51 | 0.00 | 0.00 | 0.00 | 31.51
| 0.00 | 0.00 | 100.00 | 0.00 | 0.00 | 0.00 |
| 0.00 | 0.00 | 100.00 | 0.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
3 | 0 | 0 | 0 | 329 | 0 | 0 | 329
| 0.00 | 0.00 | 0.00 | 21.20 | 0.00 | 0.00 | 21.20
| 0.00 | 0.00 | 0.00 | 100.00 | 0.00 | 0.00 |
| 0.00 | 0.00 | 0.00 | 100.00 | 0.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
4 | 0 | 0 | 0 | 0 | 192 | 0 | 192
| 0.00 | 0.00 | 0.00 | 0.00 | 12.37 | 0.00 | 12.37
| 0.00 | 0.00 | 0.00 | 0.00 | 100.00 | 0.00 |
| 0.00 | 0.00 | 0.00 | 0.00 | 100.00 | 0.00 |
---------+--------+--------+--------+--------+--------+--------+
Total 320 217 489 329 192 5 1552
20.62 13.98 31.51 21.20 12.37 0.32 100.00
The SAS System 82
20:39 Thursday, December 15, 2022
The CONTENTS Procedure
Data Set Name WORK.NHEFS3 Observations 1552
Member Type DATA Variables 9
Engine V9 Indexes 0
Created 12/15/2022 20:39:02 Observation Length 72
Last Modified 12/15/2022 20:39:02 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64,
LINUX_X86_64, ALPHA_TRU64,
LINUX_IA64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 2
First Data Page 1
Max Obs per Page 908
Obs in First Data Page 866
Number of Data Set Repairs 0
Filename /tmp/SAS_work8BA800007A0B_
jrgant-AW/nhefs3.sas7bdat
Release Created 9.0401M7
Host Created Linux
Inode Number 7998382
Access Permission rw-rw-r--
Owner Name jrgant
File Size 192KB
File Size (bytes) 196608
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat
2 age Num 8 BEST12. BEST32.
9 alcfreqcat Char 1
6 alcoholfreq Num 8 BEST12. BEST32.
8 allergies Num 8 BEST12. BEST32.
5 asthma Num 8 BEST12. BEST32.
1 sbp Num 8 BEST12. BEST32.
4 smokeintensity Num 8 BEST12. BEST32.
7 weakheart Num 8 BEST12. BEST32.
3 wt71 Num 8 BEST12. BEST32.
The SAS System 83
20:39 Thursday, December 15, 2022
Obs sbp age wt71 smokeintensity
1 175 42 79.04 30
2 123 36 58.63 20
3 115 56 56.81 20
4 148 68 59.42 3
5 118 40 87.09 20
Obs asthma weakheart allergies alcfreqcat
1 0 0 0 1
2 0 0 0 0
3 0 0 0 3
4 0 1 0 2
5 0 0 0 2
The SAS System 84
20:39 Thursday, December 15, 2022
The MEANS Procedure
Variable N Mean Std Dev Minimum
----------------------------------------------------------------------
age 1547 43.6528765 12.0298947 25.0000000
wt71 1547 70.9031157 15.3891998 39.5800000
smokeintensity 1547 20.5416936 11.7258480 1.0000000
sbp 1547 128.7039431 19.0608817 87.0000000
----------------------------------------------------------------------
Variable Maximum
------------------------------
age 74.0000000
wt71 151.7300000
smokeintensity 80.0000000
sbp 229.0000000
------------------------------
The SAS System 85
20:39 Thursday, December 15, 2022
The FREQ Procedure
Cumulative Cumulative
asthma Frequency Percent Frequency Percent
-----------------------------------------------------------
0 1474 95.28 1474 95.28
1 73 4.72 1547 100.00
Cumulative Cumulative
allergies Frequency Percent Frequency Percent
--------------------------------------------------------------
0 1448 93.60 1448 93.60
1 99 6.40 1547 100.00
Cumulative Cumulative
alcfreqcat Frequency Percent Frequency Percent
---------------------------------------------------------------
0 320 20.69 320 20.69
1 217 14.03 537 34.71
2 489 31.61 1026 66.32
3 329 21.27 1355 87.59
4 192 12.41 1547 100.00
Cumulative Cumulative
weakheart Frequency Percent Frequency Percent
--------------------------------------------------------------
0 1512 97.74 1512 97.74
1 35 2.26 1547 100.00
The SAS System 86
20:39 Thursday, December 15, 2022
The FREQ Procedure
Cumulative Cumulative
sbp_hi Frequency Percent Frequency Percent
-----------------------------------------------------------
0 1192 76.80 1192 76.80
1 360 23.20 1552 100.00
Frequency Missing = 77
The SAS System 87
20:39 Thursday, December 15, 2022
The FREQ Procedure
Table of sbp_hi by qsmk
sbp_hi qsmk
Frequency|
Percent |
Row Pct |
Col Pct | 0| 1| Total
---------+--------+--------+
0 | 908 | 284 | 1192
| 58.51 | 18.30 | 76.80
| 76.17 | 23.83 |
| 78.34 | 72.26 |
---------+--------+--------+
1 | 251 | 109 | 360
| 16.17 | 7.02 | 23.20
| 69.72 | 30.28 |
| 21.66 | 27.74 |
---------+--------+--------+
Total 1159 393 1552
74.68 25.32 100.00
Frequency Missing = 77
Statistics for Table of sbp_hi by qsmk
Statistic DF Value Prob
------------------------------------------------------
Chi-Square 1 6.0872 0.0136
Likelihood Ratio Chi-Square 1 5.9256 0.0149
Continuity Adj. Chi-Square 1 5.7508 0.0165
Mantel-Haenszel Chi-Square 1 6.0833 0.0136
Phi Coefficient 0.0626
Contingency Coefficient 0.0625
Cramer's V 0.0626
Fisher's Exact Test
----------------------------------
Cell (1,1) Frequency (F) 908
Left-sided Pr <= F 0.9939
Right-sided Pr >= F 0.0088
Table Probability (P) 0.0028
Two-sided Pr <= P 0.0155
Sample Size = 1552
Frequency Missing = 77
The SAS System 88
20:39 Thursday, December 15, 2022
The REG Procedure
Model: MODEL1
Dependent Variable: sbp
Number of Observations Read 1629
Number of Observations Used 1552
Number of Observations with Missing Values 77
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 4673.90689 4673.90689 12.98 0.0003
Error 1550 558280 360.18067
Corrected Total 1551 562954
Root MSE 18.97843 R-Square 0.0083
Dependent Mean 128.70941 Adj R-Sq 0.0077
Coeff Var 14.74517
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 127.69888 0.55747 229.07 <.0001
qsmk 1 3.99069 1.10782 3.60 0.0003
Parameter Estimates
Variable DF 95% Confidence Limits
Intercept 1 126.60541 128.79235
qsmk 1 1.81771 6.16367
The SAS System 89
20:39 Thursday, December 15, 2022
The REG Procedure
Model: MODEL1
Dependent Variable: sbp
Number of Observations Read 1629
Number of Observations Used 1552
Number of Observations with Missing Values 77
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 7 98121 14017 46.56 <.0001
Error 1544 464833 301.05758
Corrected Total 1551 562954
Root MSE 17.35101 R-Square 0.1743
Dependent Mean 128.70941 Adj R-Sq 0.1706
Coeff Var 13.48076
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 113.85479 2.95509 38.53 <.0001
qsmk 1 1.51803 1.03207 1.47 0.1415
smokeyrs 1 0.06761 0.08043 0.84 0.4007
smokeintensity 1 -0.06613 0.03933 -1.68 0.0929
diabetes 1 -0.62827 0.44678 -1.41 0.1599
sex 1 -16.63281 3.36583 -4.94 <.0001
age 1 0.39023 0.09439 4.13 <.0001
sex_age 1 0.28503 0.07558 3.77 0.0002
Parameter Estimates
Variable DF 95% Confidence Limits
Intercept 1 108.05838 119.65120
qsmk 1 -0.50638 3.54245
smokeyrs 1 -0.09016 0.22537
smokeintensity 1 -0.14328 0.01102
diabetes 1 -1.50463 0.24809
sex 1 -23.23489 -10.03073
age 1 0.20507 0.57538
sex_age 1 0.13678 0.43329
The SAS System 90
20:39 Thursday, December 15, 2022
The GENMOD Procedure
Model Information
Data Set WORK.NHEFS
Distribution Normal
Link Function Identity
Dependent Variable sbp
Number of Observations Read 1629
Number of Observations Used 1552
Missing Values 77
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 1550 558280.0358 360.1807
Scaled Deviance 1550 1552.0000 1.0013
Pearson Chi-Square 1550 558280.0358 360.1807
Scaled Pearson X2 1550 1552.0000 1.0013
Log Likelihood -6769.1980
Full Log Likelihood -6769.1980
AIC (smaller is better) 13544.3961
AICC (smaller is better) 13544.4116
BIC (smaller is better) 13560.4380
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Standard Wald 95% Confidence Wald
Parameter DF Estimate Error Limits Chi-Square
Intercept 1 127.6989 0.5571 126.6070 128.7908 52540.9
qsmk 1 3.9907 1.1071 1.8208 6.1606 12.99
Scale 1 18.9662 0.3404 18.3106 19.6453
Analysis Of Maximum
Likelihood Parameter
Estimates
Parameter Pr > ChiSq
Intercept <.0001
qsmk 0.0003
Scale
NOTE: The scale parameter was estimated by maximum likelihood.
The SAS System 91
20:39 Thursday, December 15, 2022
The GENMOD Procedure
Model Information
Data Set WORK.NHEFS
Distribution Normal
Link Function Identity
Dependent Variable sbp
Number of Observations Read 1629
Number of Observations Used 1552
Missing Values 77
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Deviance 1544 464832.8969 301.0576
Scaled Deviance 1544 1552.0000 1.0052
Pearson Chi-Square 1544 464832.8969 301.0576
Scaled Pearson X2 1544 1552.0000 1.0052
Log Likelihood -6627.0482
Full Log Likelihood -6627.0482
AIC (smaller is better) 13272.0965
AICC (smaller is better) 13272.2132
BIC (smaller is better) 13320.2222
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Standard Wald 95% Wald
Parameter DF Estimate Error Confidence Limits Chi-Square
Intercept 1 113.8548 2.9475 108.0779 119.6317 1492.13
qsmk 1 1.5180 1.0294 -0.4996 3.5356 2.17
smokeyrs 1 0.0676 0.0802 -0.0896 0.2248 0.71
smokeintensity 1 -0.0661 0.0392 -0.1430 0.0108 2.84
diabetes 1 -0.6283 0.4456 -1.5017 0.2451 1.99
Analysis Of Maximum
Likelihood Parameter
Estimates
Parameter Pr > ChiSq
Intercept <.0001
qsmk 0.1403
smokeyrs 0.3994
smokeintensity 0.0919
diabetes 0.1586
The SAS System 92
20:39 Thursday, December 15, 2022
The GENMOD Procedure
Analysis Of Maximum Likelihood Parameter Estimates
Standard Wald 95% Wald
Parameter DF Estimate Error Confidence Limits Chi-Square
sex 1 -16.6328 3.3571 -23.2127 -10.0529 24.55
sex_age 1 0.2850 0.0754 0.1373 0.4328 14.29
age 1 0.3902 0.0942 0.2057 0.5748 17.18
Scale 1 17.3062 0.3106 16.7080 17.9259
Analysis Of Maximum
Likelihood Parameter
Estimates
Parameter Pr > ChiSq
sex <.0001
sex_age 0.0002
age <.0001
Scale
NOTE: The scale parameter was estimated by maximum likelihood.
The SAS System 93
20:39 Thursday, December 15, 2022
The LOGISTIC Procedure
Model Information
Data Set WORK.NHEFS
Response Variable sbp_hi
Number of Response Levels 2
Model binary logit
Optimization Technique Fisher's scoring
Number of Observations Read 1629
Number of Observations Used 1552
Response Profile
Ordered Total
Value sbp_hi Frequency
1 0 1192
2 1 360
Probability modeled is sbp_hi=1.
NOTE: 77 observations were deleted due to missing values for the response
or explanatory variables.
Model Convergence Status
Convergence criterion (GCONV=1E-8) satisfied.
Model Fit Statistics
Intercept
Intercept and
Criterion Only Covariates
AIC 1683.227 1679.301
SC 1688.574 1689.996
-2 Log L 1681.227 1675.301
Testing Global Null Hypothesis: BETA=0
Test Chi-Square DF Pr > ChiSq
Likelihood Ratio 5.9256 1 0.0149
Score 6.0872 1 0.0136
Wald 6.0586 1 0.0138
The SAS System 94
20:39 Thursday, December 15, 2022
The LOGISTIC Procedure
Analysis of Maximum Likelihood Estimates
Standard Wald
Parameter DF Estimate Error Chi-Square Pr > ChiSq
Intercept 1 -1.2858 0.0713 325.0998 <.0001
qsmk 1 0.3282 0.1333 6.0586 0.0138
Odds Ratio Estimates
Point 95% Wald
Effect Estimate Confidence Limits
qsmk 1.388 1.069 1.803
Association of Predicted Probabilities and Observed Responses
Percent Concordant 23.1 Somers' D 0.065
Percent Discordant 16.6 Gamma 0.163
Percent Tied 60.3 Tau-a 0.023
Pairs 429120 c 0.532
Estimate
Standard
Label Estimate Error z Value Pr > |z| Exponentiated
qsmk (1 vs. 0) 0.3282 0.1333 2.46 0.0138 1.3885
The SAS System 95
20:39 Thursday, December 15, 2022
The GENMOD Procedure
Model Information
Data Set WORK.NHEFS
Distribution Binomial
Link Function Logit
Dependent Variable sbp_hi
Number of Observations Read 1629
Number of Observations Used 1552
Number of Events 360
Number of Trials 1552
Missing Values 77
Response Profile
Ordered Total
Value sbp_hi Frequency
1 1 360
2 0 1192
PROC GENMOD is modeling the probability that sbp_hi='1'. One way to change
this to model the probability that sbp_hi='0' is to specify the DESCENDING
option in the PROC statement.
Parameter Information
Parameter Effect
Prm1 Intercept
Prm2 qsmk
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Log Likelihood -837.6506
Full Log Likelihood -837.6506
AIC (smaller is better) 1679.3012
AICC (smaller is better) 1679.3089
BIC (smaller is better) 1689.9958
Algorithm converged.
The SAS System 96
20:39 Thursday, December 15, 2022
The GENMOD Procedure
Analysis Of Maximum Likelihood Parameter Estimates
Standard Wald 95% Confidence Wald
Parameter DF Estimate Error Limits Chi-Square
Intercept 1 -1.2858 0.0713 -1.4256 -1.1460 325.10
qsmk 1 0.3282 0.1333 0.0668 0.5895 6.06
Scale 0 1.0000 0.0000 1.0000 1.0000
Analysis Of Maximum
Likelihood Parameter
Estimates
Parameter Pr > ChiSq
Intercept <.0001
qsmk 0.0139
Scale
NOTE: The scale parameter was held fixed.
Contrast Estimate Results
Mean Mean L'Beta Standard
Label Estimate Confidence Limits Estimate Error
qsmk (1 vs. 0) 0.5813 0.5167 0.6433 0.3282 0.1333
Exp(qsmk (1 vs. 0)) 1.3884 0.1851
Contrast Estimate Results
L'Beta Chi-
Label Alpha Confidence Limits Square Pr > ChiSq
qsmk (1 vs. 0) 0.05 0.0668 0.5895 6.06 0.0139
Exp(qsmk (1 vs. 0)) 0.05 1.0691 1.8031
The SAS System 97
20:39 Thursday, December 15, 2022
The GENMOD Procedure
Model Information
Data Set WORK.NHEFS
Distribution Binomial
Link Function Log
Dependent Variable sbp_hi
Number of Observations Read 1629
Number of Observations Used 1552
Number of Events 360
Number of Trials 1552
Missing Values 77
Response Profile
Ordered Total
Value sbp_hi Frequency
1 1 360
2 0 1192
PROC GENMOD is modeling the probability that sbp_hi='1'. One way to change
this to model the probability that sbp_hi='0' is to specify the DESCENDING
option in the PROC statement.
Parameter Information
Parameter Effect
Prm1 Intercept
Prm2 qsmk
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Log Likelihood -837.6506
Full Log Likelihood -837.6506
AIC (smaller is better) 1679.3012
AICC (smaller is better) 1679.3089
BIC (smaller is better) 1689.9958
Algorithm converged.
The SAS System 98
20:39 Thursday, December 15, 2022
The GENMOD Procedure
Analysis Of Maximum Likelihood Parameter Estimates
Standard Wald 95% Confidence Wald
Parameter DF Estimate Error Limits Chi-Square
Intercept 1 -1.5299 0.0559 -1.6394 -1.4204 749.85
qsmk 1 0.2474 0.0987 0.0539 0.4409 6.28
Scale 0 1.0000 0.0000 1.0000 1.0000
Analysis Of Maximum
Likelihood Parameter
Estimates
Parameter Pr > ChiSq
Intercept <.0001
qsmk 0.0122
Scale
NOTE: The scale parameter was held fixed.
Contrast Estimate Results
Mean Mean L'Beta Standard
Label Estimate Confidence Limits Estimate Error
qsmk (1 vs. 0) 1.2807 1.0553 1.5542 0.2474 0.0987
Exp(qsmk (1 vs. 0)) 1.2807 0.1265
Contrast Estimate Results
L'Beta Chi-
Label Alpha Confidence Limits Square Pr > ChiSq
qsmk (1 vs. 0) 0.05 0.0539 0.4409 6.28 0.0122
Exp(qsmk (1 vs. 0)) 0.05 1.0553 1.5542
The SAS System 99
20:39 Thursday, December 15, 2022
The GENMOD Procedure
Model Information
Data Set WORK.NHEFS
Distribution Poisson
Link Function Log
Dependent Variable sbp_hi
Number of Observations Read 1629
Number of Observations Used 1552
Missing Values 77
Class Level Information
Class Levels Values
seqn 1629 233 235 244 245 252 257 262 266 419 420 428 431
434 443 446 455 457 596 603 604 605 616 618 619
620 804 806 813 816 818 825 828 831 1094 1096 1101
1103 1104 1106 1109 1116 1120 1124 1126 1127 1129
1133 1135 1148 1476 1480 1498 1505 1513 1515 1519
1523 ...
Parameter Information
Parameter Effect
Prm1 Intercept
Prm2 qsmk
Algorithm converged.
GEE Model Information
Correlation Structure Independent
Subject Effect seqn (1629 levels)
Number of Clusters 1629
Clusters With Missing Values 77
Correlation Matrix Dimension 1
Maximum Cluster Size 1
Minimum Cluster Size 0
Algorithm converged.
GEE Fit Criteria
QIC 2302.3462
QICu 2302.4294
The SAS System 100
20:39 Thursday, December 15, 2022
The GENMOD Procedure
Analysis Of GEE Parameter Estimates
Empirical Standard Error Estimates
Standard 95% Confidence
Parameter Estimate Error Limits Z Pr > |Z|
Intercept -1.5299 0.0559 -1.6394 -1.4204 -27.38 <.0001
qsmk 0.2474 0.0987 0.0539 0.4409 2.51 0.0122
Contrast Estimate Results
Mean Mean L'Beta Standard
Label Estimate Confidence Limits Estimate Error
qsmk (1 vs. 0) 1.2807 1.0553 1.5542 0.2474 0.0987
Exp(qsmk (1 vs. 0)) 1.2807 0.1265
Contrast Estimate Results
L'Beta Chi-
Label Alpha Confidence Limits Square Pr > ChiSq
qsmk (1 vs. 0) 0.05 0.0539 0.4409 6.28 0.0122
Exp(qsmk (1 vs. 0)) 0.05 1.0553 1.5542
Obs i l m x y
1 1 0 1 1 0
2 2 0 1 1 1
3 3 0 0 0 0
4 4 0 1 0 1
5 5 0 0 1 0
6 6 1 1 0 1
7 7 0 0 0 0
8 8 1 0 0 0
9 9 0 0 1 0
10 10 1 1 0 1
11 11 0 0 1 0
12 12 0 1 0 0
13 13 1 0 0 0
14 14 0 0 0 0
15 15 0 1 0 1
16 16 0 0 0 0
17 17 0 1 0 1
18 18 1 1 1 1
19 19 1 1 1 0
20 20 0 1 1 1
FIRST LOGISTIC REGRESSION MODEL
The GENMOD Procedure
Model Information
Data Set WORK.SIM
Distribution Binomial
Link Function Logit
Dependent Variable y
Number of Observations Read 500
Number of Observations Used 500
Number of Events 197
Number of Trials 500
Response Profile
Ordered Total
Value y Frequency
1 1 197
2 0 303
PROC GENMOD is modeling the probability that y='1'. One way to change this
to model the probability that y='0' is to specify the DESCENDING option in
the PROC statement.
Parameter Information
Parameter Effect
Prm1 Intercept
Prm2 x
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Log Likelihood -321.7442
Full Log Likelihood -321.7442
AIC (smaller is better) 647.4883
AICC (smaller is better) 647.5125
BIC (smaller is better) 655.9175
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Standard Wald 95% Confidence Wald
Parameter DF Estimate Error Limits Chi-Square
Intercept 1 -0.9245 0.1383 -1.1956 -0.6534 44.67
x 1 0.9656 0.1887 0.5958 1.3354 26.19
Scale 0 1.0000 0.0000 1.0000 1.0000
Analysis Of Maximum
Likelihood Parameter
Estimates
Parameter Pr > ChiSq
Intercept <.0001
x <.0001
Scale
NOTE: The scale parameter was held fixed.
Contrast Estimate Results
Mean Mean L'Beta Standard
Label Estimate Confidence Limits Estimate Error Alpha
x effect 0.7242 0.6447 0.7917 0.9656 0.1887 0.05
Exp(x effect) 2.6265 0.4956 0.05
Contrast Estimate Results
L'Beta Chi-
Label Confidence Limits Square Pr > ChiSq
x effect 0.5958 1.3354 26.19 <.0001
Exp(x effect) 1.8145 3.8017
SECOND LOGISTIC REGRESSION MODEL
The GENMOD Procedure
Model Information
Data Set WORK.SIM
Distribution Binomial
Link Function Logit
Dependent Variable y
Number of Observations Read 500
Number of Observations Used 500
Number of Events 197
Number of Trials 500
Response Profile
Ordered Total
Value y Frequency
1 1 197
2 0 303
PROC GENMOD is modeling the probability that y='1'. One way to change this
to model the probability that y='0' is to specify the DESCENDING option in
the PROC statement.
Parameter Information
Parameter Effect
Prm1 Intercept
Prm2 x
Prm3 l
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Log Likelihood -316.6752
Full Log Likelihood -316.6752
AIC (smaller is better) 639.3504
AICC (smaller is better) 639.3988
BIC (smaller is better) 651.9943
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Standard Wald 95% Confidence Wald
Parameter DF Estimate Error Limits Chi-Square
Intercept 1 -1.0722 0.1483 -1.3628 -0.7816 52.29
x 1 0.8656 0.1924 0.4884 1.2427 20.23
l 1 0.6609 0.2075 0.2543 1.0676 10.15
Scale 0 1.0000 0.0000 1.0000 1.0000
Analysis Of Maximum
Likelihood Parameter
Estimates
Parameter Pr > ChiSq
Intercept <.0001
x <.0001
l 0.0014
Scale
NOTE: The scale parameter was held fixed.
Contrast Estimate Results
Mean Mean L'Beta Standard
Label Estimate Confidence Limits Estimate Error
x effect, ctrl l 0.7038 0.6197 0.7760 0.8656 0.1924
Exp(x effect, ctrl l) 2.3763 0.4573
Contrast Estimate Results
L'Beta Chi-
Label Alpha Confidence Limits Square Pr > ChiSq
x effect, ctrl l 0.05 0.4884 1.2427 20.23 <.0001
Exp(x effect, ctrl l) 0.05 1.6297 3.4651
FIRST RUN OF THE REGFUN MACRO
The GENMOD Procedure
Model Information
Data Set WORK.SIM
Distribution Binomial
Link Function Logit
Dependent Variable y
Number of Observations Read 500
Number of Observations Used 500
Number of Events 197
Number of Trials 500
Response Profile
Ordered Total
Value y Frequency
1 1 197
2 0 303
PROC GENMOD is modeling the probability that y='1'. One way to change this
to model the probability that y='0' is to specify the DESCENDING option in
the PROC statement.
Parameter Information
Parameter Effect
Prm1 Intercept
Prm2 x
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Log Likelihood -321.7442
Full Log Likelihood -321.7442
AIC (smaller is better) 647.4883
AICC (smaller is better) 647.5125
BIC (smaller is better) 655.9175
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Standard Wald 95% Confidence Wald
Parameter DF Estimate Error Limits Chi-Square
Intercept 1 -0.9245 0.1383 -1.1956 -0.6534 44.67
x 1 0.9656 0.1887 0.5958 1.3354 26.19
Scale 0 1.0000 0.0000 1.0000 1.0000
Analysis Of Maximum
Likelihood Parameter
Estimates
Parameter Pr > ChiSq
Intercept <.0001
x <.0001
Scale
NOTE: The scale parameter was held fixed.
Contrast Estimate Results
Mean Mean L'Beta Standard
Label Estimate Confidence Limits Estimate Error Alpha
x effect 0.7242 0.6447 0.7917 0.9656 0.1887 0.05
Exp(x effect) 2.6265 0.4956 0.05
Contrast Estimate Results
L'Beta Chi-
Label Confidence Limits Square Pr > ChiSq
x effect 0.5958 1.3354 26.19 <.0001
Exp(x effect) 1.8145 3.8017
SECOND RUN OF THE REGFUN MACRO
The GENMOD Procedure
Model Information
Data Set WORK.SIM
Distribution Binomial
Link Function Logit
Dependent Variable y
Number of Observations Read 500
Number of Observations Used 500
Number of Events 197
Number of Trials 500
Response Profile
Ordered Total
Value y Frequency
1 1 197
2 0 303
PROC GENMOD is modeling the probability that y='1'. One way to change this
to model the probability that y='0' is to specify the DESCENDING option in
the PROC statement.
Parameter Information
Parameter Effect
Prm1 Intercept
Prm2 x
Criteria For Assessing Goodness Of Fit
Criterion DF Value Value/DF
Log Likelihood -321.7442
Full Log Likelihood -321.7442
AIC (smaller is better) 647.4883
AICC (smaller is better) 647.5125
BIC (smaller is better) 655.9175
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Standard Wald 95% Confidence Wald
Parameter DF Estimate Error Limits Chi-Square
Intercept 1 -0.9245 0.1383 -1.1956 -0.6534 44.67
x 1 0.9656 0.1887 0.5958 1.3354 26.19
Scale 0 1.0000 0.0000 1.0000 1.0000
Analysis Of Maximum
Likelihood Parameter
Estimates
Parameter Pr > ChiSq
Intercept <.0001
x <.0001
Scale
NOTE: The scale parameter was held fixed.
Contrast Estimate Results
Mean Mean L'Beta Standard
Label Estimate Confidence Limits Estimate Error
x effect, ctrl l 0.7242 0.6447 0.7917 0.9656 0.1887
Exp(x effect, ctrl l) 2.6265 0.4956
Contrast Estimate Results
L'Beta Chi-
Label Alpha Confidence Limits Square Pr > ChiSq
x effect, ctrl l 0.05 0.5958 1.3354 26.19 <.0001
Exp(x effect, ctrl l) 0.05 1.8145 3.8017