Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Does anyone can help with stata program\'s command? stata please :( I just want

ID: 3175446 • Letter: D

Question

Does anyone can help with stata program's command? stata please :(

I just want to know about the "commands" of this problem not the values since the values are too many

cigs smked |

    per day |

while preg |      Freq.     Percent        Cum.

------------+-----------------------------------

          0 |        993       84.15       84.15

          1 |          2        0.17       84.32

          2 |          4        0.34       84.66

          3 |          6        0.51       85.17

          4 |          8        0.68       85.85

          5 |         18        1.53       87.37

          6 |          6        0.51       87.88

          7 |          4        0.34       88.22

          8 |          4        0.34       88.56

          9 |          1        0.08       88.64

         10 |         44        3.73       92.37

         12 |          5        0.42       92.80

         15 |         15        1.27       94.07

         20 |         57        4.83       98.90

         30 |          5        0.42       99.32

         40 |          6        0.51       99.83

         46 |          1        0.08       99.92

         50 |          1        0.08      100.00

------------+-----------------------------------

      Total |      1,180      100.00

      birth |

    weight, |

     ounces |      Freq.     Percent        Cum.

------------+-----------------------------------

         23 |          1        0.08        0.08

         30 |          1        0.08        0.17

         38 |          1        0.08        0.25

         50 |          1        0.08        0.34

         58 |          2        0.17        0.51

         60 |          1        0.08        0.59

         61 |          1        0.08        0.68

         64 |          2        0.17        0.85

         68 |          2        0.17        1.02

         69 |          1        0.08        1.10

         71 |         2        0.17        1.27

         72 |          2        0.17        1.44

         73 |          2        0.17        1.61

         74 |          3        0.25        1.86

         75 |          3        0.25        2.12

         76 |          3        0.25        2.37

         77 |          1        0.08        2.46

         78 |          1        0.08        2.54

         79 |          6        0.51        3.05

         80 |          2        0.17        3.22

         81 |          3        0.25        3.47

         82 |          3        0.25        3.73

         83 |          5        0.42        4.15

         84 |          3        0.25        4.41

         85 |          2        0.17        4.58

         86 |          6        0.51        5.08

         87 |          7        0.59        5.68

         88 |          5        0.42        6.10

         89 |          6        0.51        6.61

         90 |          8        0.68        7.29

         91 |         10        0.85        8.14

         92 |          6        0.51        8.64

         93 |         10        0.85        9.49

         94 |          9        0.76       10.25

         95 |          5        0.42       10.68

         96 |         10        0.85       11.53

         97 |         14        1.19       12.71

         98 |         13        1.10       13.81

         99 |          8        0.68       14.49

        100 |         11        0.93       15.42

        101 |         15        1.27       16.69

        102 |         16        1.36       18.05

        103 |         14        1.19       19.24

        104 |         26        2.20       21.44

        105 |         13        1.10       22.54

        106 |         20        1.69       24.24

        107 |         20        1.69       25.93

        108 |         21        1.78       27.71

        109 |         21        1.78       29.49

        110 |         21        1.78       31.27

        111 |         14        1.19       32.46

        112 |         34        2.88       35.34

        113 |         23        1.95       37.29

        114 |         29        2.46       39.75

        115 |         29        2.46       42.20

        116 |         18        1.53       43.73

        117 |         24        2.03       45.76

        118 |         19        1.61       47.37

        119 |         30        2.54       49.92

        120 |         36        3.05       52.97

        121 |         18        1.53       54.49

        122 |         27        2.29       56.78

        123 |         25        2.12       58.90

        124 |         25        2.12       61.02

        125 |         24        2.03       63.05

        126 |         23        1.95       65.00

        127 |         21        1.78       66.78

        128 |         33        2.80       69.58

        129 |         19        1.61       71.19

        130 |         20        1.69       72.88

        131 |         17        1.44       74.32

        132 |         15        1.27       75.59

        133 |         17        1.44       77.03

        134 |         22        1.86       78.90

        135 |         14        1.19       80.08

        136 |         23        1.95       82.03

        137 |         14        1.19       83.22

        138 |         12        1.02       84.24

        139 |         20        1.69       85.93

        140 |          9        0.76       86.69

        141 |         19        1.61       88.31

        142 |         14        1.19       89.49

        143 |         12        1.02       90.51

        144 |         11        0.93       91.44

        145 |          9        0.76       92.20

        146 |         10        0.85       93.05

        147 |          6        0.51       93.56

        148 |          4        0.34       93.90

        149 |          9        0.76       94.66

        150 |          3        0.25       94.92

        151 |          6        0.51       95.42

        152 |         10        0.85       96.27

        153 |          3        0.25       96.53

        154 |          3        0.25       96.78

        155 |          4        0.34       97.12

        156 |          4        0.34       97.46

        157 |          2        0.17       97.63

        158 |          3        0.25       97.88

        159 |         6        0.51       98.39

        160 |          6        0.51       98.90

        161 |          3        0.25       99.15

        164 |          1        0.08       99.24

        166 |          2        0.17       99.41

        167 |          1        0.08       99.49

        169 |          1        0.08       99.58

        170 |          1        0.08       99.66

        172 |          1        0.08       99.75

        176 |          1        0.08       99.83

        192 |          1        0.08       99.92

        271 |          1        0.08      100.00

------------+-----------------------------------

      Total |      1,180      100.00

2. Smoking and birth outcomes The data set bwght.dta contains two variables: the birth weight (in ounces) of a newborn and the number of cigarettes the mother smoked per day during pregnancy. a) Load the data set in Stata (via the use command). Construct a dummy variable (using the gen command) named anycig that equals one if the mother smoked at least one cigarette per day and zero otherwise. Use the tab command (or whatever command you like) to determine what share percent) of moms smoked during pregnancy. b) Use the ttest command to test the null hypothesis that the average birth weight of babies born to smokers vs. non-smokers is the same. Report the means, t-statistic, and p-value. Can you reject the hypothesis at the 5% level? How about the 1% level? c) Rather than looking at the effect of smoking versus not smoking, we want to refine our analysis to look at the effect of how many cigarettes a pregnant woman smokes. Use the reg command to estimate by OLS the regression bwght Bo B cigsi ui. Report your regression results in standard form. What is the marginal effect on birthweight of smoking an additional cigarette? Is the effect statistically significant?

Explanation / Answer

*Part-a

*Use following commands to use data in C-directory

use “C:wght.dta”,clear

*generate dummy variable using following commands

gen anycig = 0

replace anycig = 1 if smoke>=1

tab anycig

*Part-b

ttest bwght, by(anycig)

*Part-c

reg bwght cigs

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote