## Bootstrap for assessing regression coefficient in Proc Logistic

Solved
Occasional Contributor
Posts: 9

# Bootstrap for assessing regression coefficient in Proc Logistic

Dear Braintrust,

I am analyzing data to predict an outcome in 600 calves (lung lesions 0/1) based on clinical signs observed in calves.

I used Proc logistic to obtain the regression coefficient. I want to make some prediction rules based on these coefficients.

however, I want to take into account overoptimistic weights and I therefore want to have robust estimates of these regressions coefficients.

I want to know if there is any macro to be able to obtain distribution of these regression coefficients based on bootstrapped samples.

Many thanks!

basic code I used:

proc logistic data=final;

class x1 x2 x3 x4;

model lesion = x1 x2 x3 x4;

run;

Accepted Solutions
Solution
‎05-18-2017 11:16 AM
SAS Super FREQ
Posts: 3,837

## Re: Bootstrap for assessing regression coefficient in Proc Logistic

[ Edited ]

For a general overview of how to bootstrap in SAS, see "Compute a bootstrap confidence interval in SAS"

To resample from the data to form the bootstrap samples:

1) Use PROC SURVEYSELECT to draw B samples with replacement from your data. You will obtain one SAS data set that has a REPLICATE variable that identifies the B samples:

``````proc surveyselect data=final NOPRINT seed=12345
out=SAMPLES
method=urs              /* resample with replacement */
samprate=1              /* each bootstrap sample has N observations */
OUTHITS
reps=10;       /* generate this many bootstrap resamples */
run;``````

2) Use a BY REPLICATE statement in your PROC LOGISTIC code:

``````proc logistic data=SAMPLES;
by REPLICATE;
class x1 x2 x3 x4;
model lesion = x1 x2 x3 x4;
run;``````

3. To analyze the bootstrap estimates, follow the ideas in "Simulate many samples from a logistic regression model."

All Replies
Solution
‎05-18-2017 11:16 AM
SAS Super FREQ
Posts: 3,837

## Re: Bootstrap for assessing regression coefficient in Proc Logistic

[ Edited ]

For a general overview of how to bootstrap in SAS, see "Compute a bootstrap confidence interval in SAS"

To resample from the data to form the bootstrap samples:

1) Use PROC SURVEYSELECT to draw B samples with replacement from your data. You will obtain one SAS data set that has a REPLICATE variable that identifies the B samples:

``````proc surveyselect data=final NOPRINT seed=12345
out=SAMPLES
method=urs              /* resample with replacement */
samprate=1              /* each bootstrap sample has N observations */
OUTHITS
reps=10;       /* generate this many bootstrap resamples */
run;``````

2) Use a BY REPLICATE statement in your PROC LOGISTIC code:

``````proc logistic data=SAMPLES;
by REPLICATE;
class x1 x2 x3 x4;
model lesion = x1 x2 x3 x4;
run;``````

3. To analyze the bootstrap estimates, follow the ideas in "Simulate many samples from a logistic regression model."

☑ This topic is solved.