Answered You can hire a professional tutor to get the answer.

QUESTION

I need assistance with the script. Theres are several steps. Part I: Descriptive Statistics (Scenario A) Scenario A:

I need assistance with the script. Theres are several steps.

1. Part I: Descriptive Statistics (Scenario A)

Scenario A: National Weather Service

Imagine you are a data analyst working at the National Weather Service. Your primary job is to analyze historical weather data for regions within the United States collected by the agency. Your analysis will lead to updating important weather pattern models based on historical trends and your findings will be published in academic journals. As you can see, it is critical for an analyst to provide accurate analysis of the data so that proper interpretations and publications can be achieved. You are now given a task to analyze historical weather data for the city of Manchester in New Hampshire. You will be using monthly weather data collected for the city of Manchester to help task.

Use the following table as a reference guide for the variables of interest for this project.

VariableDefinitionEMXPExtreme Maximum Precipitation (Highest monthly maximum precipitation) reported in tenths of a millimeter.EMXTExtreme Maximum Temperature (Highest monthly maximum temperature) reported in tenths of a degree Celsius.EMNTExtreme Minimum Temperature (Lowest monthly minimum temperature) reported in tenths of a degree Celsius.MMXTMean Maximum Temperature (Average monthly maximum temperature) reported in tenths of a degree Celsius.MMNTMean Minimum Temperature (Average monthly maximum temperature) reported in tenths of a degree Celsius.MNTMMean Temperature (Average monthly temperature) reported in tenths of a degree Celsius.

Step 1: Import your data set

You will be working with the Manchester Weather data set. To ensure that you analyze the correct data set, make the following edits to the function underneath "Step 1: Import your data set" in the Tool Panel on the left side of the screen.

Uncomment line 11 ???DATASET_NAME??? manchesterweather

Step 2: Calculate descriptive statistics for Extreme Maximum Temperature (EMXT)

You will need to calculate the following descriptive statistics for the variable EMXT:

Mean

Median

Variance

Standard Deviation

Minimum

Maximum

25th Percentile

75th Percentile

In order to perform these functions, you need to make the appropriate modifications to correct Python functions within the provided script. In other words, you should:

Uncomment lines 17 - 52 ???DATASET_NAME??? manchesterweather the

...for each of the required Python functions listed above.

Step 3: Calculate descriptive statistics for Extreme Maximum Precipitation (EMXP)

You will need to calculate the following descriptive statistics for the variable EMXP:

Mean

Median

Variance

Standard Deviation

Minimum

Maximum

25th Percentile

75th Percentile

In order to perform these functions, you need to make the appropriate modifications to associated Python functions listed within the provided script. In other words, you should:

Uncomment lines 56 - 89 ???DATASET_NAME??? manchesterweather the

for each of the required Python functions listed above.

2. Part I: Confidence Intervals (Scenario A)

Step 4: Construct confidence interval for population proportion

Construct a 99% confidence interval for the proportion of months with highest monthly maximum temperatures above 19 degrees celsius (EMXT>190). In order to perform this function, you need to make the appropriate modifications to the provided script. In other words, you should:

- - Uncomment - ???DATASET_NAME??? manchesterweather the ???Xvalue??? the appropriate

Step 5: Construct confidence interval for population mean

Construct a 95% confidence interval for average highest monthly maximum precipitation (EMXP). In order to perform this function, you need to make the appropriate modifications to the provided script. In other words, you should:

Uncomment lines 106 - 113 ???DATASET_NAME??? manchesterweather the

Step 6: Perform hypothesis test for population proportion

It is claimed that 67% of the months have highest monthly maximum temperatures above 19 degrees celsius (EMXT>190). Is there sufficient evidence to suggest that the proportion is 67%? Test this claim using a hypothesis test at 5% level of significance. In order to perform this function, you need to make the appropriate modifications to the provided script. In other words, you should:

- - Uncomment - ???DATASET_NAME??? manchesterweather the ???Xvalue??? the appropriate ???NULL_VALUE??? the appropriate the hypothesis the appropriate alternative hypothesis

Step 7: Perform hypothesis test for population mean

It is claimed that average highest monthly maximum precipitation is 28 millimeters (EMXP=280). Test this claim using a hypothesis test at 1% level of significance. In order to perform this function, you need to make the appropriate modifications to the provided script. In other words, you should:

Uncomment lines 131 - 139 ???DATASET_NAME??? manchesterweather the ???NULL_VALUE??? the appropriate the hypothesis the appropriate alternative hypothesis

step 8: Get your results

Once you have confirmed that your code is correct by passing each of the self-assessments, it is time to get the results of your statistical tests. First, you must uncomment all of the lines of your scripting file that are not instructional, as indicated below:

lines - Uncomment lines - Uncomment lines - Uncomment lines - Uncomment lines - Uncomment lines -

________________________________________________________________________________________________

Script::

####### Milestone 1 Python Script

import pandas as pd

import scipy.stats as st

from snhu_MAT243 import prop_1samp_ztest

from snhu_MAT243 import means_1samp_ttest

##Step 1: Import your data set

##-----------------------------------------------------------------------------

???DATASET_NAME??? = pd.read_csv('???FILENAME???')

##Step 2: Calculate descriptive statistics

##-----------------------------------------------------------------------------

# print ('Descriptive Statistics - Step 2')

# print ('')

# print ('Mean')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].mean())

# print ('')

# print ('Median')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].median())

# print ('')

# print ('Mode')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].mode())

# print ('')

# print ('Minimum')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].min())

# print ('')

# print ('Maximum')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].max())

# print ('')

# print ('Mean')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].var())

# print ('')

# print ('Standard Deviation')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].std())

# print ('')

# print ('Describe')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].describe())

# print ('')

# print ('')

##Step 3: Calculate descriptive statistics

##-----------------------------------------------------------------------------

# print ('Descriptive Statistics - Step 3')

# print ('')

# print ('Mean')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].mean())

# print ('')

# print ('Median')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].median())

# print ('')

# print ('Mode')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].mode())

# print ('')

# print ('Minimum')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].min())

# print ('')

# print ('Maximum')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].max())

# print ('')

# print ('Mean')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].var())

# print ('')

# print ('Standard Deviation')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].std())

# print ('')

# print ('Describe')

# print (???DATASET_NAME???[['???VARIABLE_NAME???']].describe())

# print ('')

##Step 4: Construct confidence interval for population proportion

##-----------------------------------------------------------------------------

# 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 ('')

##Step 5: Construct confidence interval for population mean

##-----------------------------------------------------------------------------

# print ('Confidence Interval - Step 5')

# n = ???DATASET_NAME???[['???VARIABLE_NAME???']].count()

# df = n - 1

# mean = ???DATASET_NAME???[['???VARIABLE_NAME???']].mean()

# stdev = ???DATASET_NAME???[['???VARIABLE_NAME???']].std()

# stderror = stdev/(n**0.5)

# print (st.t.interval(0.95, df, mean, stderror))

# print ('')

##Step 6: Perform hypothesis test for population proportion

##-----------------------------------------------------------------------------

# print ('Hypothesis Test - Step 6')

# n = ???DATASET_NAME???[['???VARIABLE_NAME???']].count()

# x = (???DATASET_NAME???[['???VARIABLE_NAME???']] > ???Xvalue???).values.sum()

# null_value = ???NULL_VALUE???

# alternative = '???TEST_TYPE???'

# print (prop_1samp_ztest(x, n, null_value, alternative))

# print ('')

##Step 7: Perform hypothesis test for population mean

##-----------------------------------------------------------------------------

# print ('Hypothesis Test - Step 7')

# n = ???DATASET_NAME???[['???VARIABLE_NAME???']].count()

# df = n - 1

# mean = ???DATASET_NAME???[['???VARIABLE_NAME???']].mean()

# std_dev = ???DATASET_NAME???[['???VARIABLE_NAME???']].std()

# null_value = ???NULL_VALUE???

# alternative = '???TEST_TYPE???'

# print (means_1samp_ttest(mean, std_dev, n, null_value, alternative))

# print ('')

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question