Question
Lab 2 - T-tests In this lab, we will be using the autosubset.dta dataset. This dataset contains data on automobiles in 1978. We are interested
Lab 2 - T-tests
In this lab, we will be using the autosubset.dta dataset. This dataset contains data on automobiles in 1978. We are interested in looking at differences of gas mileage between domestic cars and foreign cars. Our hypothesis that we want to test is that there is a difference in gas mileage between domestic cars and foreign cars.
- After loading the dataset into Stata, usedescribe to get an overview of the dataset. Identify which variables are going to be our dependent variable (DV) and independent variable (IV) for the research situation above. (0.5 point)
- Usecodebook for both the IV and DV. What type of variable is the dependent variable? What type of variable is the IV? (don't just use numeric, I want to know if the variable is a ratio, interval, ordinal or nominal variable) (1 point)
- Let's look at the summary statistics by using thesummarize command on the DV. What is the mean and SD of the DV? (0.5 point)
- However, this will only give us summary statistics for the DV across the entire sample. I want to look at summary statistics for the DV separated by the IV. We will do this by usingby. Using the command used previously, addby IV: to the front of the code. If you get an error, replaceby withbysort. Run this and this should give you two outputs for summary statistics of the DV by the IV.
- What is the average fuel mileage for domestic cars? (0.5 point)
- What is the average fuel mileage for foreign cars? (0.5 point)
- Let's look at the mean differences using graphs. Let's start with a bar graph. Use thegraph bar command to display the average fuel mileage over the IV. Usehelp graph bar if you need help with the code.
- Save the graph as a .png and insert it into this file. (1 point)
- I want to visualize the variability of the gas mileage over the IV. Use thegraph box command to generate a box plot of gas mileage over the IV. Save the graph as a .png and insert it into this file. (1 point)
- It's finally time to run our t-test. But first, state the null hypothesis using mathematical notation for the t-test we want to conduct. (0.5 point)
- Now interpret the null hypothesis in plain English (0.5 point)
- Now state the alternative hypothesis both in notation and in plain English (1 point)
- For this test, we will set alpha to 0.05 (this is the default in Stata). Interpret alpha: (1 point)
- Finally, it's time to run our t-test. Use thettestcommand to conduct a t-test to test our hypothesis. Usehelp ttest to find the correct syntax for the command.Use the output of the t-test and answer the following questions:
- Report the results of your t-test using APA format. (1 point)
- Interpret p and what can you conclude in terms of the null hypothesis? (1 point)
- Report the 95% confidence interval using APA format. (0.5 point)
- Use theesize command to find the effect size. Use the same code used for the t-test but replace thettest command withesize twosample. Report Cohen's d. (0.5 point)
- Using the information from this lab, briefly report the results of the t-test as if writing for an APA formatted article (4 points). But sure to include the following:
- Means and standard deviations of mileage for both groups.
- t-test results with 95% confidence intervals and Cohen's d
Here is the data:
V
BPT@Pricend Model"B0T@`Q
BPT@Mileage (mpg)"B0T@`Q
BPT@Repair Record 1978B0T@`Q
BPT@Headroom (in.)978B0T@`Q
BPT@Trunk space (cu. ft.)0T@`Q
BPT@Weight (lbs.)u. ft.)0T@`Q
BPT@Length (in.)u. ft.)0T@`Q
BPT@Turn Circle (ft.) .)0T@`Q
BPT@Displacement (cu. in.)0T@`Q
BPT@Gear Ratiot (cu. in.)0T@`Q
BPT@Car typeot (cu. in.)0T@`Q
BPT@ar typeot (cu. in.)0T@`Q
BPT@
@ r (ye@?AMC Spirit @@ P #yE@@@Buick C..@ (...;@@Buick Electra"@+^q=@@Buick L..@V +R.@@Buick R..@ *...;@ABuick R..`@(+...;@ABuick Skylark`@
H
*E@ ACad. D..@,...@0ACad. Eldorado8 [1]`@<+^( @@ACad. Seville">@@<..\@PAChev. Impalae
I@..#@pAChev. M..`@l R.@AChev. Monte C..]@" )R.@AChev. M..]@ (R.@AChev. NovaCarlos`@
f
+ #@ADodge ColtCarlo@H#b\b@ADodge D..@ .>{@ADodge M..@ .>{@ADodge St. R..@ .(<@AFord Fiestagiso%
? "!bI@AFord Mustangiso[@<..E@ALinc. Continental, `@.@ALinc. Mark Vntal5 @..@ALinc. V..`@ ).{@AMerc. Bobcatles @@ ...@AMerc. C..`@0.0@AMerc. M..`@ ,.@AMerc. Monarches@@*...@BMerc. XR-7rles
@@"..0@BMerc. Zephyres `@ +E@BOlds 98onadosn"@+^q=@ BOlds Cutl S..@ *...;@BOlds C..@ *...;@BOlds Delta 8..@j *R.@BOlds Omega88sU@ *
+E@BOlds S..c@ (R.@ BOlds Toronados(
`@..=@$BPlym.Arrowos'@<..C@(BPlym. ChamposI" @<..;@,BPlym. Horizons@..W@0BPlym. SapporosV? .b@4BPlym. Volares[1]@[..N@8BPont. C..@t *R.@ *E@@BPont.Grand P..>@ -...;@DBPont. Le M..`@ (...;@HBPont. PhoenixixH`@<..E@LBPont. S..]@ )R.@PBAudi 5000irdix%@@ %L@TBAudi Foxbirdix @ $al@XBBMW 320iirdix&@ Z "yh@\BDatsun 200rdixU?B #wx@`BDatsun 210rdix#@ Ul@dBDatsun 510rdix@"w\b@hBDatsun 810rdix@ &'33c@lBFiat Stradadix@R$iW@pBHonda Accordix@@ $k33C@tBHonda Civicix"@"[33S@xBMazda GLCcix`@ !VRn@|BPeugeot 604ix2 `@ \ &e@BRenault Le Carx7 @@ &"O{n@BSubaru Le Carx # @ [1]$a s@BToyota Celicax @ j $ C@BToyota Corollax @@ #apM@BToyota CoronaxW@ n $33C@BVW Dasheroax@ p$a)\o@BVW Dieselonax)@@#Z...q@BVW RabbitonaxY@@#Y...q@BVW S..@$a...q@'BVolvo 260oax. @ b %R>@"B
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started