[R] Asymmetrical Confidence Interval

Muhuri, Pradip (SAMHSA/CBHSQ) Pradip.Muhuri at samhsa.hhs.gov
Mon Jun 20 14:50:47 CEST 2011


Dear Patrick,


I do agree with you that it is a very simple problem.  Actually, I do have the following SAS program written to compute the asymmetrical confidence interval.

As a new user of R, I just wanted to see the corresponding codes in R if they already exist.

Thanks,

Pradip 



*SAS program begins here;

/********************************************************
MEAN = prevalence rate
PLOWER = lower 95% confidence limit for the rate
PPER = upper 95% confidence limit for the rate
TLOWER = lower 95% confidence limit for the total
TUPPER = upper 95% confidence limit for the total

Calculate the 95% CI FOR PREVALENCE RATES AND TOTALS 
********************************************************/

IF MEAN=0 OR MEAN=1 THEN DO;
      L=.;
      NUMBER=.;
      A=.;  B=.;
      PLOWER=.; PUPPER=.; TLOWER=.; TUPPER=.;
END;


ELSE DO;

      L=LOG(MEAN/(1-MEAN));
      NUMBER=SEMEAN/(MEAN*(1-MEAN));
      A=L-1.96*NUMBER;
      B=L+1.96*NUMBER;
      PLOWER=1/(1+EXP(-A));  PUPPER=1/(1+EXP(-B)); 
      TLOWER=WSUM*PLOWER;    TUPPER=WSUM*PUPPER;

END;

RUN;

*SAS program ends here:


Pradip K. Muhuri, PhD
Statistician
Substance Abuse & Mental Health Services Administration
The Center for Behavioral Health Statistics and Quality
Division of Population Surveys
1 Choke Cherry Road, Room 7-1023
Rockville, MD 20857

Tel: 240-276-1070
Fax: 240-276-1260
e-mail: Pradip.Muhuri at samhsa.hhs.gov


The Center for Behavioral Health Statistics and Quality your feedback.  Please click on the following link to complete a brief customer survey:   http://cbhsqsurvey.samhsa.gov

-----Original Message-----
From: Patrick Connolly [mailto:p_connolly at slingshot.co.nz] 
Sent: Sunday, June 19, 2011 1:57 AM
To: Muhuri, Pradip (SAMHSA/CBHSQ)
Cc: r-help at r-project.org; 'tlumley at u.washington.edu'
Subject: Re: [R] Asymetrical Confidence Interval

On Thu, 16-Jun-2011 at 04:43PM -0400, Muhuri, Pradip (SAMHSA/CBHSQ) wrote:

|> 
|> Dear List,
|> 

|> I wanted to calculate the asymmetrical confidence interval based on
|> the sample statistic and standard error that available from the
|> published report (complex survey-based).

|> The calculation details can be seen from pages 17-18 of the
|> document at the following link:
|> http://www.oas.samhsa.gov/nsduh/2k5MRB/2k5statInference.pdf.

|> 
|> Could someone tell me whether R has any function included in it
|> "survey" or other contributed package of R.

There might be one in a package somewhere, but it's so trivial to make
your own function by using the information you already have.

This is sounding suspiciously like a homework question. 


-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.  
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.



More information about the R-help mailing list