04.18.08
Assignment 3
Shelly K Bernard
MTH332-01
Assignment 3
PROBLEM A:
Using excel, generate a list of random 100 1s or 0s with the probability of 1s being prob=0.3
=If (rand( )<0.3,1,0)
This command means generate a uniformly random list with 1s and 0s where 1s appear 1/3 of the time; I have this list printed from J2 across to 102 on my excel sheet.
0 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0
PROBLEM B:
From the data generated in a, calculate a 95% confidence interval for the proportion of 1s in the sample.
The confidence interval is [a, b] such that
and
Where p is printed in column G in my excel worksheet and it is the p-sample/sample-proportion = which calculates how many 1s out of the 100 values in the randomly generated list; z printed in column H is the number of standard deviations you have to be away from
, the mean, to have 95% of the population under the distribution curve =(NORMINV(0.05/2, 0, 1); and s(p) printed in column I is the estimated-value/standard-error =
.
prob= 0.3
95% CONFIDENCE INTERVAL
[0.174029268 0.345970732]
p-sample
0.26
z
1.959963985
s(p)
0.043863424
PROBLEM C:
Generate a large number of at least several thousand randomly generated 1ists of 1s and 0s. Then using a fixed confidence interval from a, calculate the proportion of lists for which the SAMPLE PROPORTION of 1s lies in that confidence interval.
LIST1:1000=If(AND (a<=p-sample, p-sample<=b), 1, 0) is the command that I used in column E3 to E1001 which means if the population sample is within the fixed confidence interval [a,b] from exercise a, then print 1, otherwise print 0. Then we will be able to calculate whether any of the thousands of lists’ sample proportions exist within the fixed confidence interval from exercise a 95% of the time.
To calculate the percentage of which SAMPLE PROPORTIONS exist within the fixed confidence interval, in cell E2 I used the command:
=
I found that for the 1,000 lists of 1s and 0s, each sample proportion lied within the fixed confidence interval from exercise a only 82.8% of the time!
PROBLEM D:
For each of your several thousand lists of 100 1s or 0s, calculate a separate 95% confidence interval. Calculate the proportion of these cases for which the TRUE PROPORTION 0.3 lies in the calculated confidence intervals.
prob= 0.3
95% CONFIDENCE INTERVAL
[0.174 0.346]
[0.257 0.443]
[0.165 0.335]
[0.219 0.401]
[0.285 0.475]
[0.174 0.346]
…
p-sample
0.26
0.35
0.26
0.35
0.26
0.35
…
z
1.959963985
1.959963985
1.959963985
1.959963985
1.959963985
1.959963985
…
s(p)
0.044
0.048
0.043
0.046
0.049
0.044
…
I created 10,000 1s and 0s in columns from J2 across to 102 and rows J2 down to J1002. To calculate the percentage of the number of times the TRUE PROPORTION 0.3 lies in the calculated confidence intervals I create another list in which the command states:
IF(AND(a<=0.3, 0.3<=b), 1, 0)
Which says if 0.3 lies within the confidence interval [a,b] print a 1, otherwise print 0. Then I calculated the percentage by adding up the number of 1s present and dividing by n=1000 and printed the result in cell F1.
PROBLEM E:
Repeat this for at least one other value of prob not equal to 0.3
prob= 0.9
95% CONFIDENCE INTERVAL
[0.174 0.346]
[0.156 0.324]
[0.257 0.443]
[0.148 0.312]
[0.201 0.379]
[0.192 0.368]
…
p-sample
0.26
0.24
0.35
0.23
0.29
0.28
…
z
1.959963985
1.959963985
1.959963985
1.959963985
1.959963985
1.959963985
…
s(p)
0.044
0.043
0.048
0.042
0.045
0.050
…
CONCLUSION:
In conclusion, I found that sometimes the true proportion will lie in the confidence interval, but that doesn’t happen a lot of the time, only 5% of the time. When I created the other thousand lists I found that each of the sample proportions will NOT lie in the 1st interval 95% of the time because the other sample proportions are independent from the first; they each have their own confidence interval. In essence, you actually don’t know what the next interval will contain after creating another list of 1s and 0s. You don’t know whether or not it will contain .3 so 95% ends up telling us nothing!