Question

I am supposed to answer these questions using R software. However, I have little to no experience with R or any other type of programming. Can someone please help me with the R code for these questions?Q1. Suppose you have a population of size 5 [ie. N= corresponding numbers are: You measure sorne quantity (X) and the 21,22,2

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)

x <- 21:25
mean(x)


var_pop <- sum((x - mean(x))^2) / length(x)
var_pop

 mean(x)
[1] 23
> var_pop <- sum((x - mean(x))^2) / length(x)
> var_pop
[1] 2

a) mean = 23

b) variance = 2

2)

a) and b)

data <- expand.grid(c( 21:25),c( 21:25) ,c( 21:25))
data$xbar <- 1/3* ( data$Var1 + data$Var2 +data$Var3)

last line creates a new column of average

Please post Q3 again

Add a comment
Know the answer?
Add Answer to:
I am supposed to answer these questions using R software. However, I have little to no experience...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. Imagine you are taking samples (of size n3 fro "sampling With replacement" ensures independence. this...

    2. Imagine you are taking samples (of size n3 fro "sampling With replacement" ensures independence. this population with replacement. Recall a) Write down every possible way that you could have a sample of size 3 with replacement from this population. (hint: there will 5*5*5 125 possible combinations) Help: if you are struggling with figuring out the combinations try this code in R: expand.grid(1:15), (1:15), c(11:15)) b) For cach of these samples of size 3, calculate the sample an and record...

  • 1. Three randomly selected households are surveyed. The numbers of people in the households are 3​, 4​ and 11. Assume that samples of size n=2 are randomly selected with replacement from the populatio...

    1. Three randomly selected households are surveyed. The numbers of people in the households are 3, 4 and 11. Assume that samples of size n=2 are randomly selected with replacement from the population of3, 4, and 11. Listed below are the nine different samples. Complete parts (a) through (c).3,3 3,4 3,11 4,3 4,4 4,11 11,3 11,4 11,11a. Find the variance of each of the nine samples, then summarize the sampling distribution of the variances in the format of a table...

  • please i need to solve 2 and 3 and please explain everything and write I commend...

    please i need to solve 2 and 3 and please explain everything and write I commend sing R please, 1. Generate 5,000 iid samples from the standard normal distribution; compute the mean of these random samples. Repeat this process 100 times so you would have stored 100 sample averages. Plot the sample averages using hist() and lines(density() in R. What do you observe? 2. Compute the mean and variance of Binomial distribution with parameters m and p directly from definition...

  • I need a little more help with this question: Give an unbiased estimate of the variance...

    I need a little more help with this question: Give an unbiased estimate of the variance of the estimator using the Horvitz-Thompson estimator. (This may be compared to the value of the simpler alternative estimator.) The answer to this question is 62.46, but I need to see a proof of the variance of the estimator using the Horvitz-Thompson variance estimator to understand how to calculate it myself. I have included an image of the equation below: Note - Below is...

  • I need a little more help with this question: Give an unbiased estimate of the variance...

    I need a little more help with this question: Give an unbiased estimate of the variance of the estimator. (This may be compared to the value of the simpler alternative estimator.) The answer to this question is 62.46, but I need to see a proof to understand how to calculate it myself. Note - Below is the previous information(i.e answers) to help with the problem. Please do not provide me with answers or proofs to the questions below. I already...

  • Instructions First, download real estate data from the city of Ames, Iowa: download.file("htt...

    Instructions First, download real estate data from the city of Ames, Iowa: download.file("http://www.openintro.org/stat/data/ames.RData", destfile = "ames.RData") load("ames.RData") Now write code in R to answer the following questions. Make sure the script that you turn in includes the code that you write, the output that you get from that code (in a comment), and a sentence or more answering the question if there was one (also in a comment). Consider the variable Gr.Liv.Area of the ames data frame, which represents the...

  • I am not sure about the depths, it is asking for a total of six values,...

    I am not sure about the depths, it is asking for a total of six values, separated by commas! Problem #5: Note that this question along with all other problems that don't have the Minitab symbol beside them should be done by hand. Consider the following data, 42, 66,47,49,47,68, 46, 68, 42, 50 (a) Draw a stem and leaf plot including depths using intervals of length 5. (See p. 19 of the lab manual for an explanation of depths). Enter...

  • Please answer this question in both mathematically and with R. I need R code also.. Its...

    Please answer this question in both mathematically and with R. I need R code also.. Its urgent... 3.14 For the variables in Table 3.4, define z 3y1 y2 2y3 (3,-1,2)y. Find z and sz in two ways: (a) Evaluate z for each row of Table 3.4 and find Z and s directly from 21,22,., 210 using (3.1) and (3.5). (b) Use za'y and s2- a'Sa, as in (3.54) and (3.55). The sample mean of a random sample of n observations...

  • hello I am not too familiar with r studio. I was wonder if you can show...

    hello I am not too familiar with r studio. I was wonder if you can show me what I need to do to insert the 2018-19dailytemsamps.csv to rstudio and how I would make a histogram and box plot for it. thank you R Problems 1. Using daily winter temperatures recorded at the Minneapolis St. Paul Airport from December 21, 2018 to March 19. 2u19, we want to test if the mean max- imum temperature of a given winter day for...

  • Using the R language: Suppose we have a vector, called longvector with 1000 elements. A. How...

    Using the R language: Suppose we have a vector, called longvector with 1000 elements. A. How would you let R calculate the mean value of longvector? Write the code here: B. What if there are some NA values and you'd like R to remove the NA values when calculating the mean of longvector? Write the code here: C. How would you plot a histogram to show the distribution of values in longvector? Write the code here: D. How would you...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT