BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
afgdurrani0
Pyrite | Level 9
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;
1 ACCEPTED SOLUTION

Accepted Solutions
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

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.

View solution in original post

18 REPLIES 18
PGStats
Opal | Level 21
Confidence intervals of predicted means or
confidence intervals of individual predictions or
confidence intervals of parameter estimates ?
PG
PaigeMiller
Diamond | Level 26

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
afgdurrani0
Pyrite | Level 9
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.
PaigeMiller
Diamond | Level 26

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

--
Paige Miller
afgdurrani0
Pyrite | Level 9
Sir
I search but couldn't understand. Please you modify my proc program.
Reeza
Super User

@afgdurrani0 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. 

afgdurrani0
Pyrite | Level 9
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.
Reeza
Super User

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.

https://communities.sas.com/t5/SAS-Statistical-Procedures/Exponential-regression-and-square-root-mod...

 

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

 

http://support.sas.com/documentation/cdl/en/statug/66859/HTML/default/viewer.htm#statug_nlin_syntax0...

 

Good Luck

 

 

PGStats
Opal | Level 21

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

 

Rhetorical question, I hope. Smiley Wink

PG
SteveDenham
Jade | Level 19

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.Smiley Very Happy

afgdurrani0
Pyrite | Level 9
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 :(.
PGStats
Opal | Level 21

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
afgdurrani0
Pyrite | Level 9

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? 

 


Capture.PNG
PGStats
Opal | Level 21

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

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 ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 18 replies
  • 4291 views
  • 7 likes
  • 6 in conversation