Question

In: Statistics and Probability

Please use RStudio to answer the question and give the R command: please load data use...

Please use RStudio to answer the question and give the R command:

please load data use data:

library(MASS)

data(cats)

Use the “cats” data set to test for the variance of the body weight in male and female cats

Solutions

Expert Solution

Solution:

library(MASS)

data(cats)
dim(cats)
print(cats)

library(dplyr)
var_group= cats %>% group_by(Sex) %>%
summarise_at(vars(Bwt), funs(n(), var(., na.rm = TRUE)))
print(var_group)

Output

Sex n var
<fct> <int> <dbl>
1 F 47 0.0751
2 M 97 0.219
>


Related Solutions

Please use R or Rstudio for this exercise and show everything, including the R output. Pay...
Please use R or Rstudio for this exercise and show everything, including the R output. Pay attention in everything in Bold, please. " The quality of Pinot Noir wine is thought to be related to the properties of clarity, aroma, body, flavor, and oakiness. Data for 38 wines are given in stat5_prob1. (a) Fit a multiple linear regression model relating wine quality to these regressors. (b) Construct the ANOVA table. (c) Test for the significance of the regression in a...
This question requires using Rstudio. This is following commands to install and import data into R:...
This question requires using Rstudio. This is following commands to install and import data into R: > install.packages("ISLR") > library(ISLR) > data(Wage) The required data installed and imported, now this is description of the data: This dataset contains economic and demographic data for 3000 individuals living in the mid-Atlantic region. For each of the 3000 individuals, the following 11 variables are recorded: year: Year that wage information was recorded age: Age of worker maritl: A factor with levels 1. Never...
This question requires using Rstudio. This is following commands to install and import data into R:...
This question requires using Rstudio. This is following commands to install and import data into R: > install.packages("ISLR") > library(ISLR) > data(Wage) The required data installed and imported, now this is description of the data: This dataset contains economic and demographic data for 3000 individuals living in the mid-Atlantic region. For each of the 3000 individuals, the following 11 variables are recorded: year: Year that wage information was recorded age: Age of worker maritl: A factor with levels 1. Never...
This question requires using Rstudio. This is following commands to install and import data into R:...
This question requires using Rstudio. This is following commands to install and import data into R: > install.packages("ISLR") > library(ISLR) > data(Wage) The required data installed and imported, now this is description of the data: This dataset contains economic and demographic data for 3000 individuals living in the mid-Atlantic region. For each of the 3000 individuals, the following 11 variables are recorded: year: Year that wage information was recorded age: Age of worker maritl: A factor with levels 1. Never...
Please use R-Studio to answer the following question. I mentioned that dnorm(x, mean, sd) doesn’t give...
Please use R-Studio to answer the following question. I mentioned that dnorm(x, mean, sd) doesn’t give the probability of being exactly equal to x. So what does it give? It gives you the height of the normal curve at that x. Plot the graph of a normal random variable with mean 50 and standard deviation 10. Note you will have to create range of xvalues between 0 to 100. Then find the probability using dnorm() then use plot() command
Please Use R studio to answer the question. This is the Statistics section of Comparing Groups....
Please Use R studio to answer the question. This is the Statistics section of Comparing Groups. One month before the election, a poll of 630 randomly selected votes showed 54% planning to vote for a certain candidate. A week later, it became known that he had had an extramarital affair, and a new poll showed only 51% of 1010 voters supporting him. Do these results indicate a decrease in voter support fo his candidacy? a) Test an appropriate hypothesis as...
The Book of R (Question 20.2) Please answer using R code. Continue using the survey data...
The Book of R (Question 20.2) Please answer using R code. Continue using the survey data frame from the package MASS for the next few exercises. The survey data set has a variable named Exer , a factor with k = 3 levels describing the amount of physical exercise time each student gets: none, some, or frequent. Obtain a count of the number of students in each category and produce side-by-side boxplots of student height split by exercise. Assuming independence...
<<<<<<<<<<Please USE DATA IN QUESTION #9 TO ANSWER QUESTION 10#. #####please answere question 10 using question...
<<<<<<<<<<Please USE DATA IN QUESTION #9 TO ANSWER QUESTION 10#. #####please answere question 10 using question 9 ............. 9. A company that manufactures bicycles receives steel rods in large shipments from a supplier. From past experience, the manager knows that inches and that the lengths .12 σ = 0 are approximately normally distributed. He takes a random sample of 12 rods. The lengths of the sampled rods are as follows: 12.12 11.90 11.94 12.05 12.07 11.97 12.01 12.08 12.05 12.12...
Please answer this using Rstudio For the oyster data, calculate regression fits (simple regression) for the...
Please answer this using Rstudio For the oyster data, calculate regression fits (simple regression) for the 2D and 3D data a.1) Give null and alternative hypotheses a.2) Fit the regression model a.3) Summarize the fit and evaluation of the regression model (is the linear relationship significant). a.4 )Calculate residuals and make a qqplot. Is the normal assumption reasonable? Actual   2D   3D 13.04   47.907   5.136699 11.71   41.458   4.795151 17.42   60.891   6.453115 7.23   29.949   2.895239 10.03   41.616   3.672746 15.59   48.070   5.728880 9.94  ...
Use RStudio to answer this question. Before opening the dataset needed for this problem, you’ll need...
Use RStudio to answer this question. Before opening the dataset needed for this problem, you’ll need to call the “car” package > library(car) Now you can import the “Robey” dataset and use it to answer the question below. Name the data frame with abc: > abc <- Robey Remember to include any R code you use along with your answers! The Robey dataset contains fertility rates from a sample of countries. You want to see if total fertility rate (tfr),...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT