Message-ID: <1322754549513-4129048.post@n4.nabble.com>
Date: 2011-12-01T15:49:09Z
From: Simone Santoro
Subject: Resampling with replacement on a binary (0, 1) dataset to get Cis
In-Reply-To: <69C9F7F8-E011-470C-B89D-D21611ED0FA4@comcast.net>
Thanks.
So, suppose for one specific year (first year over 10) the percentage of
successes deriving from 100 trials with 38 successes (and 62 failures), its
value would be 38/100=0.38.
I could calculate its confidence intervals this way:
> success<-38
> total<-100
> prop.test(success,total,p=0.5,alternative="two.sided")
1-sample proportions test with continuity
correction
data: success out of total, null probability 0.5
X-squared = 5.29, df = 1, p-value = 0.02145
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
0.2863947 0.4829411
sample estimates:
p
0.38
So it would be var$1=0.38 , CI=0.286-0.483
Is it correct?
--
View this message in context: http://r.789695.n4.nabble.com/Resampling-with-replacement-on-a-binary-0-1-variable-to-get-CIs-tp4127990p4129048.html
Sent from the R help mailing list archive at Nabble.com.