Assignment 6: REGRESSION USING STATA

 

GET INTO STATA and INPUT YOUR DATA

 

1. Double click on the STATA icon in windows.

  1. At the Stata prompt, type the following:
  2.  

    input cost output

     

  3. Stata will then prompt you to enter data for the first "case" & you should enter the following data: (Do not use commas.)
  4.  

     

    Cost Output

    0 0

    1000 100

    2000 200

    6000 500

    10000 900

    11000 1000

    13000 1200

    15000 1300

    18000 1400

    19000 1500

    22000 1700

    24000 1900

     

    When you have input all the above data, type the following:

    end

     

    SAVE YOUR DATA IF YOU PLAN TO FINISH LATER

     

  5. Insert a formatted disk into the floppy drive, & click on file at the top to get the pull-down menu. Use "save as" to save your data as assign6.dta.
  6.  

    REGRESS YOUR DATA

     

  7. At the Stata prompt, type the following:
  8.  

    reg cost output

     

    CALCULATE YHAT

     

  9. At the Stata prompt, type the following:
  10.  

    predict yhat

     

    GRAPH YOUR DATA

     

  11. At the Stata prompt, type the following:

 

graph cost output

 

Try another graph:

graph cost yhat output

 

And another:

graph cost yhat output, c(ss)

 

And finally:

graph cost yhat output, c(ss) xlabel ylabel

 

ANALYZE YOUR RESULTS

 

8. What is your regression equation? (Hint: Cost = a + (b x Output)

  1. What is R2? How do you interpret it? (Hint: what does the number that you got for R2 mean? Check the definition in your text if you do not remember.)
  2. Is the independent variable significant? (Hint: use as a "rule of thumb" that t must be greater than or equal to 2 in order for the variable to be significant.)
  3. What is the fixed cost equal to in this regression equation?
  4.  

    GET OUT OF STATA

     

  5. At the Stata prompt, type:

 

exit, clear

 

E-MAIL ME ABOUT YOUR RESULTS

 

13. Get into Rocko, & send me an e-mail with a6 as the subject.

14. Answer questions 8-11 above.

 

STATA HINTS

  1. You can use Page Up to go back to previous lines you typed. Sometimes it’s easier to edit a previous line than it is to type in a new line.
  2. You can get a menu of commands by typing the following at the Stata prompt:

menu

3. If you need to edit your data file, click on editor and make the changes.