MGT6203 Data Analytics in Business Question With Verified Answers
261 views 0 purchase
Course
Introduction to Modeling for Business
Institution
Georgia Institute Of Technology
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)>...
(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?
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
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
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
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
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.