turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- 95% CI (Confidence Interval)

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-10-2015 01:49 AM

Hello

I have need the last modification in my proc programming that can also estimate the 95% CI (Confidence Interval), though my proc programming estimate 95% CL but I need 95% CI (Confidence Interval).

Best regards,

data exp;

set geumar2;

if expno=1;

run;

;

proc nlin data=exp method=marquardt;

parms B=0.5 R=0.1;

delta=0.000001;

s=sow**(1-B)-R*(1-B)*time;

if s>0 then stx=s**(1/(1-B));

else stx=0;

model stw=stx;

sb=(sow**(1-B+delta)-R*(1-B+delta)*time);

if sb>0 then sdb=(stx-sb**(1/(1-B+delta)))/delta;

else sdb=0;

der.B=sdb;

sr=(sow**(1-B)-(R-delta)*(1-B)*time);

if sr>0 then sdr=(stx-sr**(1/(1-B)))/delta;

else sdr=0;

der.R=sdr;

output out=expp p=pstw r=stw_residual;

run;

proc summary data=expp;

var stw_residual stw;

output out=stats css(stw)=sstot uss(stw_residual)=ssres N=N;

run;

data expp;

set stats;

rsquared=1-(ssres/sstot);

adjrsquared = 1-(1-rsquared)*(N-1) / (N- 2 -1);

run;

proc print data=expp;

run;

I have need the last modification in my proc programming that can also estimate the 95% CI (Confidence Interval), though my proc programming estimate 95% CL but I need 95% CI (Confidence Interval).

Best regards,

data exp;

set geumar2;

if expno=1;

run;

;

proc nlin data=exp method=marquardt;

parms B=0.5 R=0.1;

delta=0.000001;

s=sow**(1-B)-R*(1-B)*time;

if s>0 then stx=s**(1/(1-B));

else stx=0;

model stw=stx;

sb=(sow**(1-B+delta)-R*(1-B+delta)*time);

if sb>0 then sdb=(stx-sb**(1/(1-B+delta)))/delta;

else sdb=0;

der.B=sdb;

sr=(sow**(1-B)-(R-delta)*(1-B)*time);

if sr>0 then sdr=(stx-sr**(1/(1-B)))/delta;

else sdr=0;

der.R=sdr;

output out=expp p=pstw r=stw_residual;

run;

proc summary data=expp;

var stw_residual stw;

output out=stats css(stw)=sstot uss(stw_residual)=ssres N=N;

run;

data expp;

set stats;

rsquared=1-(ssres/sstot);

adjrsquared = 1-(1-rsquared)*(N-1) / (N- 2 -1);

run;

proc print data=expp;

run;

Accepted Solutions

Solution

09-25-2015
06:23 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-11-2015 11:06 AM

I was confused by your request, because NLIN automatically gives you the 95% confidence intervals for the parameter estimates. Bootstrap gives an alternative approach. But now I think you are requesting a way to program this outside of NLIN, possibly in the same data step used for the R2 calcuation. You know that you can use an ODS output statement to get the parameter estimates and confidence intervals saved as a data file. Then you would have them for other processing. The default method for the confidence interval is

estimate +/- t.SE,

where t is the 97.5 percentile of the t distrubiton with the error degrees of freedom (with large df, t is about 2). Thus, you can check your work.

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-10-2015 01:26 PM

Confidence intervals of predicted means or

confidence intervals of individual predictions or

confidence intervals of parameter estimates ?

confidence intervals of individual predictions or

confidence intervals of parameter estimates ?

PG

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-10-2015 02:07 PM

You can get confidence intervals for the parameters using the BOOTSTRAP command in PROC NLIN.

You can get confidence intervals for the predicted values using the OUTPUT statement in PROC NLIN.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-10-2015 02:33 PM

I'm looking for confidence intervals for the parameters. But sir(s) I don't have full command over SAS programming as I'm Fisheries specialist. I need you to insert the modify program into my above proc program please.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-10-2015 02:34 PM

Surely you can look up the BOOTSTRAP command in SAS Help. It's not really that hard to use.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PaigeMiller

09-10-2015 02:44 PM

Sir

I search but couldn't understand. Please you modify my proc program.

I search but couldn't understand. Please you modify my proc program.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-10-2015 03:40 PM

UmarKhan wrote:

But sir(s) I don't have full command over SAS programming as I'm Fisheries specialist. I need you to insert the modify program into my above proc program please.

That's not how this forum works. Your entire program above was written by people on this forum. I question how you can interpret the results if you don't understand how things are calculated. Are you even certain it's doing what you want/need?

If you want someone to write programs for you, hire a consultant. If you want HELP then please feel free to post questions here. Your questions are beyond the help category at this point and more do my work for me.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-10-2015 04:37 PM

Dear Reeza

I am trying to learn sas programming but due to a big difference between my field and such programming that creates a barrier in my learning. I have try this http://www.ats.ucla.edu/stat/sas/faq/bootstrap.htm but couldn't get any idea.

P.S I can interpret the result and have used sas in my all publication. It doesn't mean that if someone can't write sas program he would also can't interpret the result.

Only adjusted r2 is inserted in above proc program, and I have 12 more such proc. I just need one more thing that is 95% ci and for which I dontu think to hire a consultant if I have approach to expert like you through sas community.

I am trying to learn sas programming but due to a big difference between my field and such programming that creates a barrier in my learning. I have try this http://www.ats.ucla.edu/stat/sas/faq/bootstrap.htm but couldn't get any idea.

P.S I can interpret the result and have used sas in my all publication. It doesn't mean that if someone can't write sas program he would also can't interpret the result.

Only adjusted r2 is inserted in above proc program, and I have 12 more such proc. I just need one more thing that is 95% ci and for which I dontu think to hire a consultant if I have approach to expert like you through sas community.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-10-2015 05:15 PM

But how do you know the programmer inputted the correct options to generate said output?

Your original code is from this question, albeit you modified it from the sample provided.

Re: current question - here's the documentation for the bootstrap statement.

Good Luck

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

09-10-2015 11:16 PM

"*But how do you know the programmer inputted the correct options to generate said output*?"

Rhetorical question, I hope.

PG

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PGStats

09-11-2015 12:45 PM

Not rhetorical at all, PG. Shoot, some days I put gunk into code that I have no idea as to what is going to happen.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-10-2015 10:50 PM

Dear Reeza

the proc program I have and the one suggested in this group both are different. The suggested ones generate very different values than mine ones. And I got these oroc from my Lab.

And I fist make calculations with hand for few samples than I match it with sas results, in this way I varify sas results.

Still J didn't get my answer .

the proc program I have and the one suggested in this group both are different. The suggested ones generate very different values than mine ones. And I got these oroc from my Lab.

And I fist make calculations with hand for few samples than I match it with sas results, in this way I varify sas results.

Still J didn't get my answer .

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-10-2015 11:26 PM

I find the structure of your model equation quite strange, with parameter *B* being used both as an exponent and as a factor... but that is not a SAS issue. Try adding the statement

`bootstrap / bootci(BC) bootplots(all);`

to proc NLIN to get the confidence intervals. Look at the scatter graph (produced if **ods graphics** is **on**) to see the relationship between your parameter estimates.

PG

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PGStats

09-11-2015 02:40 AM

Sir I didn't get any result. I got this error: ERROR: Procedure BOOTSTRAP not found.

Can't I get the 95% CI like the ones (95% CL, see the attach image) genereted by my proc automatically?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UmarKhan

09-11-2015 10:43 AM

At this point, I can only quote @PaigeMiller "*Surely you can look up the BOOTSTRAP command in SAS Help. It's not really that hard to use.*" and point you to @Reeza's references above.

Ultimately, you will need to show some basic understanding of the statistical procedures you are using to defend your results.

PG