Question

The prompt for the python script is this: Construct a 99% confidence interval for the proportion...



The prompt for the python script is this:

Construct a 99% confidence interval for the proportion of days with solar power generation above 43 kWh for City A (cityA>43.0). In order to perform this function, you need to make the appropriate modifications to the provided script. In other words, you should:

Replace ???DATASET_NAME??? with solarkwh

Replace '???VARIABLE_NAME???' with the variable 'cityA'

Replace ???Xvalue??? with the appropriate value


The code they give us:

print ('Confidence Interval - Step 4')
n = ???DATASET_NAME???[['???VARIABLE_NAME???']].count()
x = (???DATASET_NAME???[['???VARIABLE_NAME???']] > ???Xvalue???).values.sum()
p = x/n*1.0
stderror = (p * (1 - p)/n)**0.5
print (st.norm.interval(0.99, p, stderror))
print ('')

What I have:

print ('Confidence Interval - Step 4')
n = solarkwh[['cityA']].count()
x = (solarkwh[['cityA']] > 43.0).values.sum()
p = x/n*1.0
stderror = (p * (1 - p)/n)**0.5
print (st.norm.interval(0.99, p, stderror))
print ('')

I need to know if my variables are correct based on what they are asking me to do

I'm not sure how this is incomplete? this is literally all the info i was given.

Homework Answers

Answer #1

Your code is fully correct.

print ('Confidence Interval - Step 4')
n = solarkwh[['cityA']].count()
x = (solarkwh[['cityA']] > 43.0).values.sum()
p = x/n*1.0
stderror = (p * (1 - p)/n)**0.5
print (st.norm.interval(0.99, p, stderror))
print ('')

The value of ???DATASET_NAME??? and  ???VARIABLE_NAME??? is already given in the question.

We need to find the 99% confidence interval for the proportion of days with solar power generation above 43 kWh.

So, the value of ???Xvalue??? should be 43 which you have already given in the question.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Construct the 99% confidence interval estimate of the population proportion p if the sample size is...
Construct the 99% confidence interval estimate of the population proportion p if the sample size is n=700 and the number of successes in the sample is x=251. ____<p<____
Construct a confidence interval estimate of the population proportion p with n = 1200, x =...
Construct a confidence interval estimate of the population proportion p with n = 1200, x = 800, alpha = 0.01
If X = 135, o = 26, and n= 38, construct a 99% confidence interval estimate...
If X = 135, o = 26, and n= 38, construct a 99% confidence interval estimate of the population mean, p (Round to two decimal places as needed.)
Construct a 99% confidence interval of the population proportion using the given information. x=75, n=150 The...
Construct a 99% confidence interval of the population proportion using the given information. x=75, n=150 The lower bound is? The upper bound is? 99% confidence has an area of each tail, alpha/2 is .005, and critical value is 2.575 (z alpha/2)
Construct a 99% confidence interval to estimate the population mean using the data below. x overbarx=15...
Construct a 99% confidence interval to estimate the population mean using the data below. x overbarx=15 s=5.6 n=12 What assumptions need to be made about this population? The 99% confidence interval for the population mean is from a lower limit of ____ to an upper limit of ____
Construct a 99% confidence interval for p subscript 1 minus p subscript 2, given x subscript...
Construct a 99% confidence interval for p subscript 1 minus p subscript 2, given x subscript 1 equals 51 comma space n subscript 1 equals 150 comma space x subscript 2 equals 45 comma space and space n subscript 2 equals 180.
1. If n=290 and X = 232, construct a 99% confidence interval. Enter your answer as...
1. If n=290 and X = 232, construct a 99% confidence interval. Enter your answer as an open-interval (i.e., parentheses) using decimals (not percents) accurate to three decimal places. Confidence interval = Express the same answer as a tri-linear inequality using decimals (not percents) accurate to three decimal places. < p < Express the same answer using the point estimate and margin of error. Give your answers as decimals, to three places. p = ±± 2. We wish to estimate...
Use the given degree of confidence and sample data to construct a confidence interval for the...
Use the given degree of confidence and sample data to construct a confidence interval for the population mean μ. Assume that the population has a normal distribution. n = 50, x = 74.6, s = 11.5, 99% confidence level. Hints: determine if the ? is known? a)State the hypothesis b)State the test statistic value c)State the p value d)Determine the null hypothesis e) Concluding statement [I checked twice. This is the exactly same question I got, no more information given....
1.)If n=400 and X=100​, construct a 95​% confidence interval estimate of the population proportion. ≤π≤ (ROUND...
1.)If n=400 and X=100​, construct a 95​% confidence interval estimate of the population proportion. ≤π≤ (ROUND 4 DECIMAL PLACES) 2.) 19A telecommunications company wants to estimate the proportion of households that would purchase an additional telephone line if it were made available at a substantially reduced installation cost. Data are collected from a random sample of 500 households. The results indicate that 120 of the households would purchase the additional telephone line at a reduced installation cost. a. Construct a...
Question 1 Suppose you needed to form a 92% confidence interval for a population mean. What...
Question 1 Suppose you needed to form a 92% confidence interval for a population mean. What z value would you use? A. 1.41 B. .82 C. 1.96 D. 1.75 Question 2 Which of the following is a way to INCREASE the width of a confidence interval? A. increase the chance for error B. increase the confidence level C. decrease the error D. increase the sample size Question 3 In a random sample of 60 computers, the mean repair cost was...