Learn R Programming

SciencesPo (version 0.3.8.27)

get.ci: Simulation of Confidence Intervals

Description

Simulate the effect of sample size and the sampling design.

Usage

get.ci(sample = NULL, n = NULL, mu = 0, sigma = 1, cl = 0.95, type = "mean")

Arguments

sample
is an integer value to simulate the sampling design.
n
the size of the sample
mu
is the proportion mean (0 to 1) of the population distribution.
sigma
is the size of variance
cl
is the value of the confidence level required, usually 0.95 to 0.99.
type
is a character string giving the type for the simulation c(mean, var, pi)

Value

  • A plot with the simulated values for CI.

References

http://danielmarcelino.com/SciencePo

Examples

Run this code
get.ci(sample = 1000, n = 1, mu = .29)

get.ci(1000, 1, .29, 2, .90)

Run the code above in your browser using DataLab