Question

The built-in R dataset swiss gives Standardized fertility measure and socio-economic indicators for each of 47...

The built-in R dataset swiss gives Standardized fertility measure and socio-economic indicators for each of 47 French-speaking provinces of Switzerland at about 1888. The dataset is a data frame containing 6 columns (variables). The column Infant.Mortality represents the average number of live births who live less than 1 year over a 3-year period. We are interested in the Infant.Mortality column. We can convert the data in this colun to an ordinary vector x by making the assignment x <- swiss$Infant.Mortality. Then we can easily access the data. We can also get the data by entering the values 1 by 1. (You would be wise to not do the 1 by 1 entry.) The following is a screen print of the data values: [1] 22.2, 22.2, 20.2, 20.3, 20.6, 26.6, 23.6, 24.9, 21.0, 24.4, 24.5, 16.5, 19.1, 22.7 [15] 18.7, 21.2, 20.0, 20.2, 10.8, 20.0, 18.0, 22.4, 16.7, 15.3, 21.0, 23.8, 18.0, 16.3 [29] 20.9, 22.5, 15.1, 19.8, 18.3, 19.4, 20.2, 17.8, 16.3, 18.1, 20.3, 20.5, 18.9,, 23.0 [43] 20.0, 19.5, 18.0, 18.2, 19.3 Assume these values are a random sample from a normal population with unknown mean μ and unknown standard deviation σ. Let x be the vector created by the assignment x <- swiss$Infant.Mortality. a) Using R, calculate the interquartile range of x 3.55 b) Calculate the sum of the squares of the elements of x. c) Calculate the sample mean of x. d) Calculate the sample variance of x. e) Calculate the sample standard deviation s of x. f) Calculate the maximum likelihood estimate of σ2 using this data. g) Calculate the maximum likelihood estimate of 6σ using this data. h) Calculate the 22nd percentile of x using R. i) Calculate the sample variance of the R vector sqrt(x). j) Calculate an unbiased estimate of σ2 using this data. k) Using this data, create a 99% confidence interval for μ, noting that the sample size is large enough so we can use a normal distribution critical value zstar.( , ) l) Using this data, create a 99% prediction interval for μ, noting that the sample size is large enough so we can use a normal distribution critical value zstar. ( , ) m) Using this data, we create a 1% level test of H0: μ=21 versus the alternative Ha: μ < 21. We will reject H0 if z = x − 21 s 47 < zstar where s is the sample standard deviation. What is the value of zstar? (Calculate from normal distribution) n) Continuing from part m, what is the value of z? o) Continuing from parts m and n, what is the p value of the test.

Homework Answers

Answer #1

Let x be the vector created by the assignment x <- swiss$Infant.Mortality. a) Using R, calculate the interquartile range of x 3.55 b) Calculate the sum of the squares of the elements of x. c) Calculate the sample mean of x. d) Calculate the sample variance of x. e) Calculate the sample standard deviation s of x.

a) Using R, calculate the interquartile range of x 3.55

Rocde:

IQR <- quantile(x,0.75)-quantile(x,0.25)
IQR

output:

IQR=3.55

b) Calculate the sum of the squares of the elements of x

Rcode:

sum_of_squares <- sum((x^2))

sum_of_squares

Output:

sum_of_squares = 19082.41

Solution:c

xbar <- mean(x)
xbar

output:

19.94255

sample mean= 19.94255

SOlutiond:

samplevar <- var(x)
samplevar

sample variance= 8.483802

Solutione:

Calculate the sample standard deviation s of x.

samplesd <- sd(x)

samplesd

Output:

2.912697

sample standard deviation=2.912697

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
The built-in R dataset swiss gives Standardized fertility measure and socio-economic indicators for each of 47...
The built-in R dataset swiss gives Standardized fertility measure and socio-economic indicators for each of 47 French-speaking provinces of Switzerland at about 1888. The dataset is a data frame containing 6 columns (variables). The column Infant.Mortality represents the average number of live births who live less than 1 year over a 3-year period. We are interested in the Infant.Mortality column. We can convert the data in this colun to an ordinary vector x by making the assignment x <- swiss$Infant.Mortality....
The built-in ldeaths data set contains measurements giving the monthly deaths from bronchitis, emphysema and asthma...
The built-in ldeaths data set contains measurements giving the monthly deaths from bronchitis, emphysema and asthma in the UK, 19741979, both sexes. We can easily access this data with the assignment x <- as.vector(ldeaths). We can also get the data by entering the values 1 by 1. (You would be wise to not do the 1 by 1 entry.) The following is a screen print of the data values:s: [1] 3035 2552 2704 2554 2014 1655 1721 1524 1596 2074...
The built-in ldeaths data set contains measurements giving the monthly deaths from bronchitis, emphysema and asthma...
The built-in ldeaths data set contains measurements giving the monthly deaths from bronchitis, emphysema and asthma in the UK, 19741979, both sexes. We can easily access this data with the assignment x <- as.vector(ldeaths). We can also get the data by entering the values 1 by 1. (You would be wise to not do the 1 by 1 entry.) The following is a screen print of the data values:s: [1] 3035 2552 2704 2554 2014 1655 1721 1524 1596 2074...
The built-in ldeaths data set contains measurements giving the monthly deaths from bronchitis, emphysema and asthma...
The built-in ldeaths data set contains measurements giving the monthly deaths from bronchitis, emphysema and asthma in the UK, 19741979, both sexes. We can easily access this data with the assignment x <- as.vector(ldeaths). We can also get the data by entering the values 1 by 1. (You would be wise to not do the 1 by 1 entry.) The following is a screen print of the data values:s: [1] 3035 2552 2704 2554 2014 1655 1721 1524 1596 2074...
*Answer all questions using R-Script* Question 1 Using the built in CO2 data frame, which contains...
*Answer all questions using R-Script* Question 1 Using the built in CO2 data frame, which contains data from an experiment on the cold tolerance of Echinochloa crus-galli; find the following. a) Assign the uptake column in the dataframe to an object called "x" b) Calculate the range of x c) Calculate the 28th percentile of x d) Calculate the sample median of x e) Calculate the sample mean of x and assign it to an object called "xbar" f) Calculate...
Use R to do each of the following. Use R code instructions that are as general...
Use R to do each of the following. Use R code instructions that are as general as possible, and also as efficient as possible. Use the Quick-R website for help on finding commands. 1. Enter the following values into a data vector named Dat: 45.4 44.2 36.8 35.1 39.0 60.0 47.4 41.1 45.8 35.6 2. Calculate the difference between the 2nd and 7th entries of this vector using only reference indices. 3. Calculate the median of Dat. 4. Sort the...
I understand that these will be considered seperate questions, but could I get a full answer...
I understand that these will be considered seperate questions, but could I get a full answer please. Thank you. 1       A civil engineering agency monitors water quality by measuring the amount of suspended solids in a sample of river water. The following results, measured in parts per million, were observed over 60 days: 21.2 19.9 20.2 15.6 17.6 14.0 19.7 18.3 26.2 23.6 20.2 19.8 22.2 27.3 23.4 19.8 22.3 16.9 16.4 22.0 19.8 21.1 20.4 18.6 21.8 22.5 20.0...
This is meant for R. AirPassengers is a time series giving the monthly totals (in thousands)...
This is meant for R. AirPassengers is a time series giving the monthly totals (in thousands) of international airline passengers, 1949 to 1960. We may convert the time series to a vector,x, with the assignment x <- as.vector(AirPassengers). Let the random variable X represent a random observation from the values in AirPassengers. Assume X has mean mu and standard deviation sigma and that there is no trend in the data and values are independent from one another. Think of x...
2. Vocabulary and R functions a) What does the symbol x-bar represent? b) What does the...
2. Vocabulary and R functions a) What does the symbol x-bar represent? b) What does the Greek letter mu (μ) represent? c) What is the difference between x-bar and mu? 3. Mean a) Many people already know how to find the mean (average) of a sample of data by "adding all the numbers and dividing by the number of values in the dataset. In your own words, another method of finding the mean by using the sample space (list of...
Question (2) [5 marks] (Use R) Suppose you have a company producing cupcakes. Each cupcake is...
Question (2) [5 marks] (Use R) Suppose you have a company producing cupcakes. Each cupcake is supposed to contain 10 grams of sugar. The cupcakes are produced by a machine that adds the sugar in a bowl before mixing everything. You believe the machine does not add 10 grams of sugar for each cupcake. If your assumption is true, the machine needs to be fixed. You stored the level of sugar of thirty cupcakes. Note: You can create a randomized...