In class assignment

University of Tennessee - AGNR220/SNR220

Dairy Farm๐Ÿ„

A dairy farm ๐Ÿฎ in Wisconsin has purchased a new dietary supplement that claims to increase the milk production. The farm has 1,000 cows, and they are giving the supplement to half of them.

After a while, you decide to measure the amount of milk production in 40 cows taking the supplement, and in 40 cows that are not taking the supplement.

Please download the datasets from Canvas.

Read them into R and convert them into a vector. Look at the following code:

(You can copy the code)

CowControl<-read.csv("CowControl.csv")
CowSupplement<-read.csv("CowSupplement.csv")
CowControl<-CowControl$x
CowSupplement<-CowSupplement$x

Step 1.

Use the sample() function to sample 40 individuals from the CowControl object. Name this object control. Use the sample() function to sample 40 individuals from the CowTreatment object. Name this object treatment.

Then, copy and paste the following code, to run your t test! Easy! ๐Ÿ˜ƒ

t.test(control,supplement, var.equal = T)

Assignment Question 1 ๐Ÿฎ

Based on your test, make a statistical decision. Does the supplement have an effect?

Assignment Question 2 ๐Ÿฎ

New information:

  • The supplement costs $30.00 for 1,000 g.

  • Each cow needs to take 100 g. each day

  • The farm sells each liter of raw milk to a processing facility at $0.40