How can I do these operations in python ?
Given a loaded dataset:
a) At the α = 0.05 significance level, test whether the variance of rental prices differs
for private room rentals compared to entire house rentals.
b) At the α = 0.01 significance level, test whether the average price of entire house
rentals is greater than the average price of private room rentals.
Sample dataset
Part a
Part b
Python code in text
import pandas as pd
data = [['House', 20000], ['House', 25000], ['House',
22000],['Private', 5000], ['Private', 7000], ['Private',
9000]]
df = pd.DataFrame(data, columns = ['accommodation', 'Price'])
print(df)
from scipy import stats
import matplotlib.pyplot as plt
ret=stats.f_oneway(df["Price"][df["accommodation"]=="House"],df["Price"][df["accommodation"]=="Private"])
print(ret)
if ret[1]<0.05:
print("Reject the null hypothesis so accommodation types have differences in variances")
else:
print("Accept the null hypothesis so accommodation types have similar variances")
df.boxplot("Price",by="accommodation")
plt.show()
Private=df[df["accommodation"]=="Private"]
entirehouse=df[df["accommodation"]=="House"]
ret=stats.ttest_ind(Private["Price"],entirehouse["Price"])
if ret[1]<0.05:
print("Reject the null hypothesis so average price of entire house is greater")
else:
print("Accept the null hypotheses so average price of entire house isn't greater")
How can I do these operations in python ? Given a loaded dataset: a) At the...
4. The FloridaLakes dataset describes characteristic of water samples taken at random Florida lakes. Acidity (pH) is given for each lake. Pure water has a pH of 7,which is neutral. with a pH less than 7 are acidic while solutions with a pH greater than 7 are basic or alkaline. A rcher Jim Lee would like to know whether on average the solutions in Florlida lakes are acidic. In order to test whether on average the solutions in Florida lakes...
Using data from the past 25 years, an investor wants to test whether the average return of Vanguard’s Precious Metals and Mining Fund is greater than 12%. Assume returns are normally distributed with a population standard deviation of 30%. Click here for the Excel Data File a. Select the null and the alternative hypotheses for the test. H0: μ ≤ 12; HA: μ > 12 H0: μ = 12; HA: μ ≠ 12 H0: μ ≥ 12; HA: μ <...
The sample data consist of 23 houses from a specific city yielded the average house price $226,460 and the standard deviation of the house price $11,500. Use a significance level 0.01 to test whether the mean house price of the whole city is more than $220,000. Compute the value of the test statistic, and P-value for the specified hypothesis test and state your conclusion. Assume the house prices of this city follows normal distribution. Question 2 options: Test statistic: t...
The sample data consist of 23 houses from a specific city yielded the average house price $226,460 and the standard deviation of the house price $11,500. Use a significance level 0.01 to test whether the mean house price of the whole city is more than $220,000. Compute the value of the test statistic, and P-value for the specified hypothesis test and state your conclusion. Assume the house prices of this city follows normal distribution. Test statistic: t = 2.69, p-value...
also calculate: the critical
value(s), the test values, and reject/do not reject the
hypothesis
The average sales price of new one-family houses in the Midwest is $252,400 and in the South is $259,500. A random sample of 36 houses in each region was examined with the following results. At the 0.05 level of significance, can it be concluded that the difference in mean sales price for the two regions is greater than $3400? Midwest South Sample size 36 36 Sample...
music do, on average, 6. Register Balance: Here we investigate whether the register balance at a local retail store is better on days with a manager than days without a manager. This evidence might be used to determine whether or not you should always schedule a manager. The table gives the register balance for a sample of 10 days with a manager and 10 days without a manager. Here, 0 means the register balance is right on, negative means there...
Using the dataset that you used for the midterm (Find it on the Blackboard), do the following: 1) (4 points) Submit the values for items a to e in the table below: mean, sample size, standard deviation, and 95% confidence interval for mean. (SPSS Command: Analyze/Descriptive Statistics/Explore) Variable Statistic Height Mean 71.2 Sample Size N 999 Standard Deviation 2.913 95% Confidence Interval for Mean Lower Bound 71.02 Upper Bound 71.38 2) (4 points) Assume that you want to test whether...
How do I find the p value? Please explain in detail
Previous Problem Problem List Next Problem 1 polnt) Here we Investigate whether the register balance at a local retail store is better on days with a manager than days without a manager. This evidence might be used to determine whether or not you should always schedule a manager. The table gives the register balance for a sample of 10 days with a manager and 10 days without a manager....
Open the "Lab Dataset"
(HSCI390.sav) you have been using for lab assignments in SPSS. Your
analysis will focus on the variables "Gender" (Gender) and "Blood
Alcohol Content at last drinking episode" (BAC).
Researchers are interested in examining if the mean Blood
Alcohol Content at last drinking episode differs between men and
women. To examine their research question of interest, they will
use data from the sample of CSUN students contained in the
HSCI390.sav dataset.
Using SPSS for the analysis, you...
I cannot figure out how to do number four. Can someone please
show me step by step how to do it?
This project is made up of 4 different parts. The dataset for all 4 parts is given in the Students are encoruraged to use software (Mimitab, excel tc) to complete the help see your professor. CARS: A sample of 20 cars, including measurements of fuel consumption (eity mi/gal and highway mi/gal), weiglit (poumds), mumber of eylinders, engine disp gases...