联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> OS作业OS作业

日期:2024-11-01 12:21

Stata Exercise and Commands

Due 11/4 (Monday) @ 11:59pm on Moodle | Solo Assignment

1. Import the Excel format data “BWGHT Excel data” into Stata and save as a Stata data file. Remember to check the "import first row as variable names" box.

Try the following command and click the save button:

label variable bwght “birth weight, ounces”

help label

2. Type clear in the command window, click enter before opening the data set “BWGHT.DTA” (Stata format, with all the labels already filled in).

3. Produce descriptive statistics for cigs, bwght, fatheduc, and male

Useful commands: sum (for continuous variables), tab (for categorical variables)

4. Regression analysis using OLS (bwght as Y)

a. Start with one control variable: cigs.

Interpret the estimated slope coefficient.

b. Then multiple controls: cigs, faminc, parity, male, white.

Interpret each estimated slope coefficient and the coefficient of determination.

c. Add fatheduc to the above set of controls. What happens to the number of observation used in this regression?

d.  Add motheduc to the equation. Should we keep both fatheduc and motheduc in the equation?

Command for joint hypothesis test after running a regression:

test fatheduc motheduc

5. Results table: look for important information such as coefficients, t-test and overall significance test results. [You only need to paste the results table here.]

6. Case selections: e.g., reg bwght cigs faminc if cigs>0

[Paste the results table here and discuss the main difference from the regression without including if cigs>0 in the command.]

7. Missing values: identify and exclude. [Try the following command, paste the results table and discuss the main difference from the regression without including if fatheduc!=. in the command.

Command: reg bwght cigs faminc if fatheduc!=.

8. Try alternative combinations of control variables as well as different measures of the dependent variable. [Paste the results tables from various regressions you tried.]

What is your final choice of the dependent variable (i.e., bwght, lbwght, or bwgthlbs) and control variables?

9. Write down your version of the estimated regression equation (with actual numeric coefficients and standard errors) and interpret each slope coefficient. See if you can make a conclusion regarding the effect of smoking on birth outcomes.

10. Based on your estimated regression equation, find the residuals for the 2nd and 36th observations.

Command after running the regression: predict residual, r

[We are creating a new variable named “residual” here.]

Try this command to list the value of the variable “residual” from the 2nd to the 36th observations:

list residual in 2/36

Alternatively, we can open the data browser window, locate the last column which is now the new variable named “residual,” and find the two values from there.



版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp