BookmarkSubscribeRSS Feed
LMB
Calcite | Level 5 LMB
Calcite | Level 5

I have a data set containing 980 paired observations of fish length and age.  I would like to use a bootstrapping approach to examine how sample size affects the precision of model parameter estimates.

I have used the following program to successfully create a dataset where 3 fish per cm length class are selected 1000 times from the original dataset:

PROC SURVEYSELECT DATA = AGE OUT = SAMPLE

     METHOD = URS

     N = 3

     SEED = 9876

     OUTHITS

     REP = 1000;

     STRATA TLINT;

RUN;

Next I fit model parameters to each replicate in this dataset:

PROC SORT DATA = SAMPLE;

BY REPLICATE;

RUN;

PROC NLIN DATA = SAMPLE;

PARMS LINF = 550 K = .25 t0 = 0.1;

MODEL TL = LINF*(1-EXP(-K*(AGE-t0)));

BY REPLICATE;

OUTPUT OUT = FITTED;

RUN;

I would like to create a dataset that contains parameter estimates for each replicate.  The dataset would contain the following variables:

REPLICATE LINF K t0

and would look like this, for example:

1 568 .25 .02

2 520 .27 .14

3 491 .32 .01

etc.

I have also attached the SAS file.

Any help would be appreciated.

5 REPLIES 5
PGStats
Opal | Level 21

Try adding the statement:

ODS OUTPUT ParameterEstimates=samplePE;

to your NLIN procedure.

PG

PG
LMB
Calcite | Level 5 LMB
Calcite | Level 5

PG,

That was helpful in summarizing the parameter estimates by replicate.  However, is there a way to get them into a format that is easier to work with?  Ideally this would be a SAS data set.

LMB
Calcite | Level 5 LMB
Calcite | Level 5

Actually I may be ok working with it by exporting to Excel.

PGStats
Opal | Level 21

In the example I gave, samplePE would be a SAS dataset containing the parameter estimates. That seemed to be what you wanted.

PG
LMB
Calcite | Level 5 LMB
Calcite | Level 5

Got it. Thanks!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 909 views
  • 3 likes
  • 2 in conversation