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
In the Python script, you calculated a 95% confidence interval for the average relative skill of...
In the Python script, you calculated a 95% confidence interval for the average relative skill of all teams in the league during the years of your team. Additionally, you calculated the probability that a given team in the league has a relative skill level less than that of the team that you picked. Info here: Confidence Level (%) Confidence Interval 95% 2013 to 2015 – 1502.02 (Rounded) 95% 2013 to 2015 – 1502.02, 1507.18 (Unrounded) **Probability a team has Average...
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 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 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 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...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT