Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: a "byable" cii


From   VISINTAINER PAUL <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: RE: a "byable" cii
Date   Thu, 6 Feb 2003 17:37:02 -0500

Thank you, Nick.  Re Bryan: the spreadsheet would have worked if the samples
were large.  However, with the options provided by -ci-, it was worth the
time to figure out how to use it.

Paul

-----Original Message-----
From: Nick Cox [mailto:[email protected]] 
Sent: Thursday, February 06, 2003 3:12 PM
To: [email protected]
Subject: st: RE: a "byable" cii

VISINTAINER PAUL
> 
> I was recently asked to compute confidence intervals for 
> several proportions
> (more than 100).  The data came in a spreadsheet in two 
> columns: numerator
> (num) and denominator (den).  I thought I could quickly run 
> them using
> either ci or cii.  However, it appears that ci doesn't read 
> summary data and
> cii is not "byable".  Despite my best efforts, I couldn't 
> devise a program
> that would read more than the first line of the data.  
> 
> My very inelegant solution to the problem was this:  I 
> converted the two
> columns of data into a single row of data with 200 columns: 
>  (e.g., num1
> num2 . . . num100 den1 den2 . . . den100).
> 
> Then I ran the following program:
> 
> 	forvalues x=1/100 {
> 	  cii den`x' num`x'
> 	}
> 
> While it worked, it was really cumbersome converting the 
> data.  I suspect
> (hope) there is an easier way to do this.  Any suggestions?

forval i = 1/100 { 
	local n = num[`i'] 
	local d = den[`i'] 
	cii `d' `n' 
} 

Nick 
[email protected] 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index