# 3. H1

This is an easy set of questions to get you started with Stata. It uses an old data set on cars from Consumer Reports that is built into Stata. To load the data into Stata, enter the following command in Stata’s command line: sysuse auto. To see what is in this data set, you can enter the Stata command describe.

a) Calculate the mean price of the automobiles in the data set. You can do this by writing summarize price in the command line. What was the mean price of automobiles in 1978?

b) Calculate the median price of the automobiles in the data set. You can do this by writing summarize price, detail in the command line. What was the median price of automobiles in 1978? What does the difference between the mean and median price indicate about the shape of the distribution for the price?

c) Make a histogram of the price of cars. You can do this by using the command histogram price. What shape does the histogram take? (Is it symmetric? Skewed?) Does the shape of the histogram coincide with what you guessed in part (b)?

d) Run the Stata command by foreign: summarize price and comment on the average price of cars for foreign versus domestic.

e) You can also obtain subgroup analysis using an if statement. Run the two commands summarize mpg if foreign==0 and summarize mpg if foreign==1, and comment on differences in average mpg between domestic and foreign cars.

f) The command histogram mpg,by(foreign) creates side by side histograms. Comment on the difference in distributions of mpg for domestic and foreign cars.

g) Make a scatter plot of the variables weight and length. You can use the command, scatter weight length. Does there appear to be any association between the variables? Also compute the correlation and covariance between weight and length.

h) Using the standard deviations of weight and length, show how the covariance divided by the standard deviations equals the correlation value.

Use the following data set listed below.

4099

4749

3799

4816

7827

5788

4453

5189

10372

4082

11385

14500

15906

3299

5705

4504

5104

3667

3955

3984

4010

5886

6342

4389

4187

11497

13594

13466

3829

5379

6165

4516

6303

3291

8814

5172

4733

4890

4181

4195

10371

4647

4425

4482

6486

4060

5798

4934

5222

4723

4424

4172

9690

6295

9735

6229

4589

5079

8129

4296

5799

4499

3995

12990

3895

3798

5899

3748

5719

7140

5397

4697

6850

11995

## Don't hesitate - Save time and Excel

Are you overwhelmed by an intense schedule and facing difficulties completing this assignment? We at GrandHomework know how to assist students in the most effective and cheap way possible. To be sure of this, place an order and enjoy the best grades that you deserve!

Post Homework
Top