100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
MGT6203 Data Analytics in Business Question With Verified Answers $14.49   Add to cart

Exam (elaborations)

MGT6203 Data Analytics in Business Question With Verified Answers

 260 views  0 purchase
  • Course
  • Institution

MGT6203 Data Analytics in Business Grade Homework#2 Part 2 Instructions for Q1 For parts A and B: PlantGrowth is a dataset in R that contains crop weights of a control group and two treatment groups. Clear the environment and get data > rm(list = ls()) > (1) > library(datasets)>...

[Show more]

Preview 2 out of 11  pages

  • June 21, 2021
  • 11
  • 2020/2021
  • Exam (elaborations)
  • Questions & answers
avatar-seller
MGT6203 Data Analytics in Business


Grade Homework#2 Part 2


Instructions for Q1

For parts A and B:

PlantGrowth is a dataset in R that contains crop weights of a control group and two treatment groups.

Clear the environment and get data

> rm(list = ls())
> set.seed(1)
> library(datasets)>
> data(PlantGrowth)
> force(PlantGrowth)

Perform the following operations:

(i) Create two separate datasets, one with datapoints of treatment 1 group along with control group
and other with datapoints of treatment 2 group with the control group.

A)

Now compute the difference estimator for treatment 1 and treatment 2 datasets that were created, in
comparison with the control group?

Clear the environment and get data
> rm(list = ls())
> set.seed(1)
> library(datasets)
> data(PlantGrowth)
> force(PlantGrowth)
weight group
1 4.17 ctrl
2 5.58 ctrl
3 5.18 ctrl
4 6.11 ctrl
5 4.50 ctrl
6 4.61 ctrl
7 5.17 ctrl
8 4.53 ctrl
9 5.33 ctrl
10 5.14 ctrl
11 4.81 trt1
12 4.17 trt1
13 4.41 trt1
14 3.59 trt1
15 5.87 trt1
16 3.83 trt1
17 6.03 trt1
18 4.89 trt1
19 4.32 trt1

, 20 4.69 trt1
21 6.31 trt2
22 5.12 trt2
23 5.54 trt2
24 5.50 trt2
25 5.37 trt2
26 5.29 trt2
27 4.92 trt2
28 6.15 trt2
29 5.80 trt2
30 5.26 trt2


Now create dummy variable for control group
> Plantdata <- PlantGrowth %>% mutate(Treat_ind = ifelse(group == "ctrl",
0,1))


Create two data sets one for treatment group 1 and one for treatment group 2
> Plantdata1 <- Plantdata[1:20,]
> Plantdata2 <- Plantdata[c(1:10,21:30),]

Use linear regression to calculate the difference estimator

lmt1 <- lm(weight ~ Treat_ind, data = Plantdata1)
> summary(lmt1)

Call:
lm.default(formula = weight ~ Treat_ind, data = Plantdata1)

Residuals:
Min 1Q Median 3Q Max
-1.0710 -0.4938 0.0685 0.2462 1.3690

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.0320 0.2202 22.850 9.55e-15 ***
Treat_ind -0.3710 0.3114 -1.191 0.249
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.6964 on 18 degrees of freedom
Multiple R-squared: 0.07308, Adjusted R-squared: 0.02158
F-statistic: 1.419 on 1 and 18 DF, p-value: 0.249

Here the difference estimator is -0.3710 for treatment group 1. (meaning weight is
0.3710 less for treatment group1 vs the control group)

Use linear regression to calculate the difference estimator for group 2

> lmt2 <- lm(weight ~ Treat_ind, data = Plantdata2)
> summary(lmt2)
Call:
lm.default(formula = weight ~ Treat_ind, data = Plantdata2)

Residuals:
Min 1Q Median 3Q Max
-0.862 -0.410 -0.006 0.280 1.078

Coefficients:

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Examhack. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $14.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73243 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$14.49
  • (0)
  Add to cart