# Urgent - Easy problems that I need help with

#### StrongStats

##### New Member
Hello,
I will post the question, then my answer. I am doing something wrong. Can anyone help me figure it out?

Question 1. To estimate how many 100,000 potential customers might buy a new product, the product is offered for sale to a random sample of 100 of the potential customers. 15 of the 100 sampled customers buy the product. Based on this data, what is an exact 95% upper confidence limit for the true fraction of potential customers that will buy the product if it is offered?

pc=15/100
se=sqrt(pc*(1-pc)/100)
pc+1.96*se
# [1] 0.219986

What did I do wrong?

#### StrongStats

##### New Member
Question 2

A study of ad effectiveness found that 20% of consumers who had not yet been exposed to a new advertising campaign (the “control group”) reported having a “favorable” or “very favorable” perception of a certain brand. By contrast, out of a simple random sample of 400 consumers who were exposed to the advertising campaign, 100 (25%) reported having a “favorable” or “very favorable” perception of the brand. The advertising company claims that their ad has increased the fraction of exposed customers with “favorable” or “very favorable” perceptions of the brand by at least
10%, from the base level of 20% in the control group to a new level of at least 22% (MLE = 25%).

Question 2a. What is the probability that 100 or more out of 400 people would respond favorably (i.e., with a “favorable” or “very favorable” perception) by chance if the true probability of such a response is 0.2?

Question 2b. What is the probability that 100 or more out of 400 people would respond favorably (i.e., with a “favorable” or “very favorable” perception) by chance if the true probability of such a response is 0.22?

#Q2
p=0.2
n=400
se=sqrt((p*(1-p))/n)
pcap=100/400
z=(pcap-p)/se
round(1-pnorm(z),4)

#Q3
p1=0.22
n=400
se1=sqrt((p1*(1-p1))/n)
pcap=100/400
z1=(pcap-p1)/se1
round(1-pnorm(z1),4)

#### StrongStats

##### New Member
Question 2c. Do the data show that, with at least 95% confidence, the fraction of exposed customers with “favorable” or “very favorable” perceptions of the brand is at least 22%? What is the smallest true probability of a “favorable” or “very favorable” response that makes the probability of observing 100 or more such responses (out of 400 people responding) at least 5%? –Simpler wording: What probability of success makes the probability of 100 or more successes (out of 400 trials, i.e., people responding) 5%?

#Q4
LL=pcap-qnorm(0.975)*sqrt((pcap*(1-pcap))/n)
UL=pcap+qnorm(0.975)*sqrt((pcap*(1-pcap))/n)
round(Interval<-c(LL,UL),4)
p2=0.5
se2=sqrt((p2*(1-p2))/n)
round(p<-pcap-qnorm(0.05)*se2,4)

#### StrongStats

##### New Member
Question 3a. An expensive machine has had 14 failures in the past 1095 days. (More than one failure can occur on a single day, although this is unlikely.) If the failure rate is a constant that must be estimated from data, what is a 95% upper confidence limit for the failure rate (average failures per day), based on the above data?

#Q5 (3a)
p=14/1095
n=1095
p+1.645*sqrt((p*(1-p))/n)
#[1] 0.0184