# NOT RUN {
# An example used in Kelley and Rausch for the expected confidence interval
# width (returns 278). Thus, a necessary sample size of 278 is required when
# the duration of the study will be 4 units and the frequency of measurement
# occasions is 1 year in order for the expected confidence interval
# width to be 0.025 units.
ss.aipe.pcm(true.variance.trend=0.003, error.variance=0.0262, duration=4,
frequency=1, width=0.025, conf.level=.95)
# Now, when incorporating an assurance parameter (returns 316).
# Thus, a necessary sample size of 316 will ensure that the 95% confidence
# interval will be sufficiently narrow (i.e., have a width less than .025 units)
# at least 99% of the time.
ss.aipe.pcm(true.variance.trend=.003, error.variance=.0262, duration=4,
frequency=1, width=.025, conf.level=.95, assurance=.99)
# }
Run the code above in your browser using DataCamp Workspace