exact confidence intervals for proportions in non-SRS setting



  • 1. data manip proc
    I have a dataset with a list of dates called dates and I want to extract data for each date from check. The stored variable does not evaluate correctly. Anyone know why? Many Thanks. data dates; set dates; format alldates mmddyy10.; run; data _null_; set dates nobs=count; call symput('stored', alldates); call symput('counter', count); run; &stored; %macro GetTop30; %do i=1 %to &counter; proc sql; create table check as select * from data where date = &&stored&i; run; %.....Some extra manipulations to check............... %end; %mend;
  • 2. SAS Code ANCOVA baseline as covariate
    I have data like this; Subject Period Sequence Formulation AUClast Pre dose value R01 1 1 S1 25.3003 1.71 R01 2 1 T2 31.6812 1.96 R01 3 1 S2 26.5744 1.72 R01 4 1 T1 28.0301 1.84 R02 1 2 S2 27.9508 1.82 R02 2 2 S1 25.528 1.61 R02 3 2 T1 21.1087 1.67 R02 4 2 T2 21.4418 1.81 R03 1 3 T1 13.7766 0.78 R03 2 3 S2 11.8601 0.78 R03 3 3 T2 11.3354 0.79 R03 4 3 S1 12.4126 0.79 R04 1 4 T2 20.071 1.49 R04 2 4 T1 15.1978 1.27 R04 3 4 S1 19.6033 1.52 R04 4 4 S2 16.9579 1.29 R05 1 4 T2 22.3924 1.7 R05 2 4 T1 22.1381 1.61 R05 3 4 S1 23.0792 1.82 R05 4 4 S2 25.7839 1.74 What will be the SAS code for ANCOVA to be run using baseline as covariate on data for comparing test low dose (T1) vs ref. Low (s1) dose and also test high dose (T2) vs ref. high dose (S2) and calculate the 95% CI for these comparisons. Thanks in advance AM
  • 3. SAS 8.2 AF Build (Source) Window: How to Persist Window Size
    Kevin, I don't have access to 8.2, but I just tested this with 9.2 Phase 2. I suspect it was the same for 8.2. You can use the SAS Registry Editor to change the values for Height, Width, HorizontalPosition, VerticalPosition: Products->AF->Design Time->Source Window It works for both the original source editor and the Enhanced Editor. -Randy -----Original Message----- From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of Kevin Myers Sent: Tuesday, July 28, 2009 3:01 PM To: XXXX@XXXXX.COM Subject: SAS 8.2 AF Build (Source) Window: How to Persist Window Size and Position Under MS Windows? Can someone please remind me how to persist the size and position of the SAS/AF Build window (source editor) when running SAS 8.2 under MS Windows? I'm pretty sure that I used to do that years ago when I was programming full time, but now it has slipped my mind and I can't seem to locate that info in the docs. I know that the WSAVE command does NOT work for this window... Thanks, Kevin M.

exact confidence intervals for proportions in non-SRS setting

Postby acavallo » Wed, 18 May 2005 14:19:58 GMT


I have a statistics question.

I understand that there are different methods for obtaining the confidence
interval for a proportion under simple random sampling.  The usual method
(normal approximation) is inappropriate for small samples and for cases
with the population proportion close to 0 or 1 (in such cases the
hypergeometric distribution is to be used).

What methods are appropriate for sampling with unequal selection
probabilities (such as proportional to size sampling) and for stratified
random sampling?

From my reading of the documentation for PROC SURVEYFREQ, it looks like SAS
uses the normal approximation method.  Is this appropriate if the
population proportion is close to 0 or 1?  What about for small samples?

Background - The hypergeometric calculation produces a confidence interval
which is potentially asymmetric.  Let H(x, n-x, A, N-A) be the
hypergeometric probability for finding in a sample of size n from a
population of size N; with x occurences in the sample and A occurences in
the population.

H(x, n-x, A, N-A) = [A choose x] * [(N-A) choose (n-x)] / [N choose n]

The upper 95% CI for the population number of occurences, A is given by
finding the smallest integer Au such that
     sum from j=0 to x {H(j, n-j, Au, N-Au)}<= 0.025.
The lower limit Al for the 95% CI on population occurences is given by the
largest integer Al such that
     sum from j=x to n {H(j, n-j, Al, N-Al)}<= 0.025.
The upper limit for the proportion is then Pu=Au/N, and the lower limit is

--Alex Cavallo
Navigant Consulting

Similar Threads:

1.QR: Confidence interval for ratios of proportions


I would like to ask how I can obtain in SAS ,  (1-alpha)% confidence interval  for the ratios of two proportions p1/p0

With p1 is the proportion of a sample n1 , and p0 is a fixed value

Thanks in advance for your suggestions


 Douvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et vids !
Crz votre Yahoo! Mail

2.Confidence interval for proportions in presence of correlated

Joakim Englund < XXXX@XXXXX.COM > wrote:
>I have a dataset with the following four variables:
>- Company
>- Company_group (to which the Company belongs to)
>- Branch_of_trade (type of business)
>- Bankruptcy (binomial, 1=Company is in bankruptcy, 0=Company is not in
>I now want to calculate a confidence interval for the proportion
>p = sum(Bankruptcy) / n
>where n is total number of observations.
>This is normally easy, but this time it has occurred to me that the
>observations are not independent. For example, if company A is in
>bankruptcy, it is more probable that other companies in the same
>Company_group as A is in bankruptcy as well. Also, if many companies in the
>same Branch_of_trade goes into bankruptcy, it is common to have a
>domino-effect, meaning that several other companies in the sane
>Branch_of_trade will follow into bankruptcy.
>Hence, the observations are correlated within Company_group as well as
>within Branch_of_trade. How can I account for this when calculating p?

Thanks for providing some context!

Two points occur to me:
1) Calculating a CI around a proportion is not as easy as you might think.  There's considerable recent literature on this, a good starting point is Agresti and Coull: Approximate is better than exact for estimation of binomial proportions.  American Statistician.  1998.  vol 52 p 119-126

2) For your particular problem, I suggest a bootstrap.  David Cassell had a paper at the most recent SGF (formerly SUGI) that gives some good advice on bootstraps in SAS



3.Exact Confidence Interval

Hi all:

            I am required to compute the Exact Confidence Interval.  The
total examined population is 150 and the number meeting criteria is 23.
Does anybody have a formula to calculate this (95%confidence level).


Thanks and regards



4.Exact confidence interval for the difference

One of our statisticians wants to know:

Does anyone know if SAS or R can compute an exact confidence interval for
the difference
in 2 binomial proportions?...the only package that I have ever seen do
this calculation is StatXact...

Bob Abelson
240 314 4400 x1374

5.how to get 95% binomial confidence intervals using the exact

6. Confidence interval for proportions in presence of correlated data

7. confidence interval for proportions

8. PROC FREQ exact binomial confidence limits

Return to sas


Who is online

Users browsing this forum: No registered users and 34 guest