Question

In: Statistics and Probability

load the MASS library in R. A. Package ‘MASS’ which provides a description of the datasets...

load the MASS library in R. A. Package ‘MASS’ which provides a description of the datasets available in the MASS package. Then, answer each of the following questions using the appropriate test statistic and following formal steps of hypothesis testing.

A:Test of equal or given proportions: Use the “bacteria” data set to answer the question, “did the drug treatment have a significant effect of the presence of the bacteria compared with the placebo?”

B: F-test: Use the “cats” data set to test for the variance of the body weight in male and female cats. Is the variance in bodyweight of male cats the same as the variance in bodyweight of female cats?

Solutions

Expert Solution

Answer A.

Null Hypothesis: There is no significant difference in the drug and placebo treatments on the proportion of bacteria

Alternative Hypothesis: The proportion of bacteria due to drug treatments are significantly less than in placebo treatment

Test:

Conclusion: Since p-value = 1 > so we fail to reject the Null Hypothesis and conclude that There is no significant difference in the drug and placebo treatments on the proportion of bacteria

Answer B:

Null Hypothesis: There is no significant difference in the variance in bodyweight of male cats and variance in bodyweight of female cats

Alternative Hypothesis: There is significant difference in the variance in bodyweight of male cats and variance in bodyweight of female cats

Test:

Conclusion: Since p-value = 0.0001157 < so we reject the Null Hypothesis and conclude that There is significant difference in the variance in bodyweight of male cats and variance in bodyweight of female cats


Related Solutions

Load the package nycflights13 with library(nycflights13). If you are on running R Studio locally, you must...
Load the package nycflights13 with library(nycflights13). If you are on running R Studio locally, you must install this package before you can use it! # install.packages("nycflights13") library(nycflights13) library(ggplot2) library(dplyr) data(flights) data(airports) data(airlines) Question 2 The dataset `airlines` contains the full name of the carrier (examine it!). Join the dataset with the flights dataset so all of the information in `flights` is retained. Using the merged dataset, which carrier (`name`) has the longest average departure delay? Which has the shortest?
USING R ---locate the pre-loaded MASS package, then load the data frame cats within that packag....
USING R ---locate the pre-loaded MASS package, then load the data frame cats within that packag. This provides data on sex, body weight (in kgs), and heart weight (in grams) for 144 household cats. Load the MASS package with a call to library("MASS"), and access the object directly by entering cats at the console prompt. 1. Fit a least-squares multiple linear regression model using heart weight as the response variable and the other two variables as predictors, and view a...
What are the R codes for these questions below: 1. Load the library {car}, which contains...
What are the R codes for these questions below: 1. Load the library {car}, which contains the Salaries data set. #Then, list the first few records with head(Salaries). The display the summmary() for this dataset, which will shows frequencies. Then, load the library {psych} which contains the describe() function and use this function to list the descriptive statistics for the dataset. 2. Load the coefplot library and display a coefficient plot for lm.fit.2 <- lm(salary~sex+yrs.since.phd, data=Salaries) using the coefplot() function....
What are the R codes for these questions below: 1. Load the library {car}, which contains...
What are the R codes for these questions below: 1. Load the library {car}, which contains the Salaries data set. #Then, list the first few records with head(Salaries). The display the summmary() for this dataset, which will shows frequencies. Then, load the library {psych} which contains the describe() function and use this function to list the descriptive statistics for the dataset. 2. Load the coefplot library and display a coefficient plot for lm.fit.2 <- lm(salary~sex+yrs.since.phd, data=Salaries) using the coefplot() function....
The data set ”airquality” in the R datasets library has data on ozone concentration, wind speed,...
The data set ”airquality” in the R datasets library has data on ozone concentration, wind speed, temperature, and solar radiation by month and day for May through September in New York. Attach airquality to your workspace and then construct side-by-side boxplots of Wind by Month. Month is a numeric variable in the airquality data frame. You can treat it as a factor by using the ”as.factor” function, e.g., > plot(Wind ∼ as.factor(Month)) Next, do an analysis of variance to determine...
Assignment: Install and load the ggplot2 package. load the "diamonds" dataset RCode: install.packages("ggplot2") library(ggplot2) ?diamonds 1....
Assignment: Install and load the ggplot2 package. load the "diamonds" dataset RCode: install.packages("ggplot2") library(ggplot2) ?diamonds 1. Explore the dataset & state insights 2. Create plots for dataset 3: Provide summary of descriptive stats) 4. Run the regressions, research, Investigate & comment on R^2 & on regression plots - 1 line each. #=========================================== # DV = Price, IV or IVs = your choice # Can we create and compare models to predict "Price"? # Question- Investigate & comment on R^2 &...
Assignment: Install and load the ggplot2 package. load the "diamonds" dataset RCode: install.packages("ggplot2") library(ggplot2) ?diamonds 1....
Assignment: Install and load the ggplot2 package. load the "diamonds" dataset RCode: install.packages("ggplot2") library(ggplot2) ?diamonds 1. Explore the dataset & state insights 2. Create plots for dataset 3: Provide summary of descriptive stats) 4. Run the regressions, research, Investigate & comment on R^2 & on regression plots - 1 line each. #=========================================== # DV = Price, IV or IVs = your choice # Can we create and compare models to predict "Price"? # Question- Investigate & comment on R^2 &...
Assignment: Install and load the ggplot2 package. load the "diamonds" dataset RCode: install.packages("ggplot2") library(ggplot2) ?diamonds 1....
Assignment: Install and load the ggplot2 package. load the "diamonds" dataset RCode: install.packages("ggplot2") library(ggplot2) ?diamonds 1. Explore the dataset & state insights 2. Create plots for dataset 3: Provide summary of descriptive stats) 4. Run the regressions, research, Investigate & comment on R^2 & on regression plots - 1 line each. #=========================================== # DV = Price, IV or IVs = your choice # Can we create and compare models to predict "Price"? # Question- Investigate & comment on R^2 &...
Load the USArrests sample dataset from the built-in datasets (data(USArrests)) into R using a dataframe (Note:...
Load the USArrests sample dataset from the built-in datasets (data(USArrests)) into R using a dataframe (Note: Row names are states, not numerical values!). Use the kmeans package to perform a clustering of the data with increasing values of k from 2 to 10 - you will need to decide whether or not to center/scale the observations - justify your choice. Plot the within-cluster sum of squares for each value of k - what is the optimal number of clusters? Use...
In the datasets package, there is a dataframe ChickWeight. The weights of the chicks are recorded...
In the datasets package, there is a dataframe ChickWeight. The weights of the chicks are recorded in gram and the variable time is measured in days. Run a regression model to show how the passage of time influences the weight of the chicks. Based on the regression results, which of the following are true? (answer may 1 or more) a.The chicks weigh about 27 grams when they hatch. b.We accept the null hypothesis that time has no effect on the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT