DOC PREVIEW
UCSB ECON 240 - Sampling Distributions

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Oct 14 2009 LAB 3 ECON 240A 1 Sampling Distributions L Phillips I The Sampling Distribution of Proportions As an example consider random samples of size 50 potential voters who are asked whether they will vote for a Proposition yes coded one For each sample the sample proportion p is calculated where p k n i e equals the fraction saying yes out of fifty As we discussed in Lecture Four these are repeated Bernoulli trials and k should have the binomial distribution with mean np and variance np 1 p So p has mean p and variance p 1 p n If p is approximately 0 5 then np easily satisfies np 5 as does n 1 p and we could use the normal distribution to approximate the binomial So p N p p 1 p n Using a value of p equals 0 5 for example we can plot this theoretical normal density function for the sample proportion p N 0 5 0 005 i e normal with mean 0 5 and variance 0 005 equivalent to a standard deviation of 0 07071 Use Excel and in the first column type in values for the sample proportion ranging from zero to one with increments of 0 01 Then in the adjacent column use normdist to calculate the density function Plot this density against the sample proportion We can also use the random number generator feature to simulate the distribution of the sample proportion Go to the tools menu data analysis and scroll down to random number generation Hit OK and in the dialog box use 10 for the number of variables entry This is the number of samples Use 50 for the number of random numbers entry This is the sample size For the distribution choose Bernoulli In each column i e for each sample this will generate 50 numbers of zero or one just like a random sample of 50 voters responding yes or no For the parameter choose p 0 5 Note you could repeat this simulation presuming p 0 6 or 0 4 for the population parameter Choose a random seed entry of 10 so we get the same random numbers i e we have replication from experimenter to experimenter and are all on the same page Check new worksheet ply for the results To calculate the sample proportion for each column select cell A51 go to the menu bar and type insert function and choose mean with an input range of A1 A50 Extend across all ten columns to obtain all ten sample proportions To obtain a histogram in cell A52 type in 0 05 for the upper limit of the first bin and go across in increments of Oct 14 2009 LAB 3 ECON 240A 2 Sampling Distributions L Phillips 0 05 You can plot a histogram of these sample proportions Go to the tools menu data analysis and histogram and hit OK For the input data range type A51 J51 and for the bin range type A52 T52 Check new worksheet ply and chart output and hit OK In cell M53 type in mean for the average of the sample proportion distribution and in cell N53 type in std dev Select cell M54 go to the menu bar type insert function select average and for the input range use A51 J51 Hit OK The mean of this simulated sample of sample proportions is 0 444 compared to the theoretical value of 0 5 Follow a similar procedure selecting cell N54 to get stdev with a calculated value of 0 066533 compared to the theoretical value of 0 07071 Repeat this process but for 50 simulated samples of 50 voters i e 50 columns of zeros and ones For the 50 simulated sample proportions I calculate a mean of 0 4876 closer to 0 5 and a standard deviation of 0 07493 Repeat this process but for 200 simulated samples of 50 voters For the 200 simulated sample proportions I calculate a mean of 0 4861 and a standard deviation of 0 0677 Table Average Sample Proportion for 50 Voters Versus Replications Av Sample 10 Replications 0 444 Proportion Standard 0 0655 50 Replications 0 4876 0 07493 200 Replications 0 4861 0 06767 Population 0 5 0 07071 Deviation The histogram of sample proportions becomes bell shaped by 50 replications and there is not a great deal of difference as we go from 50 replications to 200 replications The average sample proportion approaches the population proportion of 0 5 by 50 replications as well So the simulation was working pretty well i e according to theory by 50 replications Note that we never varied the number of voters 50 in a sample Increasing this would decrease the expected standard deviation for the sample proportion since it varies with 1 n Oct 14 2009 LAB 3 ECON 240A 3 Sampling Distributions L Phillips In the ten replications the minimum sample proportion was 0 32 with a standard deviation of 0 32 0 68 50 equal to 0 066 so the 95 confidence interval for the population proportion is 0 32 1 96 0 066 or P 0 19 p 0 45 0 95 and does not include the true population proportion of 0 5 So there are occasions when a 95 confidence interval on the population proportion will not include it and on average this occurs about 5 of the time The other nine sample proportions have 95 confidence intervals that include the population proportion II The Sampling Distribution of Means We will take a sample of 50 observations from the uniform distribution calculate the sample mean and replicate this 50 times to show that the distribution of the 50 sample means is not flat but bell shaped In this case x is uniform with mean 0 5 and variance 1 12 as we saw in Lecture Five The sample mean x has mean 0 5 and variance 1 12 divided by 50 0 00167 with a corresponding standard deviation of 0 0408 50 E x E x i 50 0 5 1 50 VAR x VAR E x i 50 1 n2 1 50 VAR x i VAR x i n 1 1 12 50 0 00167 Start with a new workbook in Excel Go to the tools menu data analysis and scroll down to random number generator Hit OK and in the dialog box use 50 for the number of variables entry This is the number of samples or replications Use 50 for the number of random numbers entry This is the sample size For the distribution choose uniform In each column i e for each sample this will generate 50 numbers ranging from zero to one Note the parameter default gives this range but there is an option to choose other ranges Choose a random seed entry of 20 so we get the same random numbers Check new worksheet ply for the results To calculate the sample mean for each column select cell A51 go to the menu bar and type insert function and choose mean with an input range of A1 A50 Extend across all fifty columns to obtain …


View Full Document

UCSB ECON 240 - Sampling Distributions

Documents in this Course
Load more
Download Sampling Distributions
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Sampling Distributions and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Sampling Distributions 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?