About

In this project, we will explore predictive analytics using the babies data set provided. This data is collected to understand different factors effecting baby weights at birth. Below are the explanations of the variables:

Count: number of observation bwt: Baby weights in ounces gestation: Length of pregnancy in days parity: = 0 if the baby is first born, =1 otherwise height: Mother’s height in inches weight: Mother’s pregnancy weight in pounds smoke: =1 if mother is smoker, = 0 Nonsmoker age: Mother’s age in years

Read this worksheet carefully and follow the instructions to complete the tasks and answer any questions. Knit your final worksheet and submit your work as an HTML or PDF or Word document in Sakai.

If you are submitting as a team project only one submission from one of the team members will be sufficient but in this case you need to input the names of the team members in the above Title section.

Task 1: Reading the babies file & understanding the relatioships (0.25 points)

#Read File and check the first 6 observations
mydata = read.csv(file="babies.csv")
head(mydata)
##   Count bwt gestation parity height weight smoke age
## 1     1 120       284      0     62    100     0  27
## 2     2 113       282      0     64    135     0  33
## 3     3 128       279      0     64    115     1  28
## 4     4 108       282      0     67    125     1  23
## 5     5 136       286      0     62     93     0  25
## 6     6 138       244      0     62    178     0  33

How can you describe the relationship between baby weights and other variables? You are expected to explain each relationship.

Gestation - As the length of pregnancy increases, baby weight also increases, meaning it is a positive linear relationship.

Parity - The first-born babies weigh less than babies born after (either the second-born or third-born), meaning it is a weak negative relationship.

Height - Taller mothers tend to have slightly heavier babies, meaning it is a weak positive relationship.

Weight - Heavier mothers tend to have heavier babies, meaning it is a moderate positive relationship.

Smoke - Babies born to smoking mothers weigh less than babies born to non-smoking mothers, meaning it is a moderate negative relationship.

Age - The more older the mother is, the heavier the baby is, meaning it is a positive linear relationship.

Task 2: Multiple Linear regression model(2.0 points)

Extract all the variables and create a multiple linear regression model.

bwt  = mydata$bwt
gestation = mydata$gestation
parity = mydata$parity
height = mydata$height
weight = mydata$weight
smoke = mydata$smoke
age = mydata$age

#Multiple Linear Regression Model
mlr1 <- lm(bwt ~ gestation + parity + height + weight + smoke + age)

#Summary of the model
summary(mlr1)
## 
## Call:
## lm(formula = bwt ~ gestation + parity + height + weight + smoke + 
##     age)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -57.613 -10.189  -0.135   9.683  51.713 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -80.41085   14.34657  -5.605 2.60e-08 ***
## gestation     0.44398    0.02910  15.258  < 2e-16 ***
## parity       -3.32720    1.12895  -2.947  0.00327 ** 
## height        1.15402    0.20502   5.629 2.27e-08 ***
## weight        0.05017    0.02524   1.987  0.04711 *  
## smoke        -8.40073    0.95382  -8.807  < 2e-16 ***
## age          -0.00895    0.08582  -0.104  0.91696    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.83 on 1167 degrees of freedom
## Multiple R-squared:  0.258,  Adjusted R-squared:  0.2541 
## F-statistic: 67.61 on 6 and 1167 DF,  p-value: < 2.2e-16

Interpret the value for the intercept (0.25 point):

The intercept, -80.41085, represents the estimated birth weight when all other variables are zero.

Interpret the value for the slope of gestation (0.25 point):

For every additional day of gestation while holding all other variables constant, the birth weight is expected to increase by 0.44398 units.

Interpret the value for the slope of weight(0.25 point):

For every additional unit of maternal weight while holding all other variables constant, the birth weight is expected to increase by 0.05017 units.

Interpret the value for the slope of smoke (0.25 point):

Babies born to smoking mothers are expected to weigh 8.40073 units less than babies born to non-smoking mothers.

Interpret the value for R-squared (0.25 point):

The R-squared value, 0.258, represents the proportion of the variance in birth weight that is explained by the variables. Meaning, 25.8% of the model is explained, whereas a significant portion of the variability remains unexplained.

Task 3 Evaluating significance/insignificance of the variables (0.5 points)

Do you think the model has insignificant variables, if so which variable(s) is/are insignificant?

Gestation, parity, height, weight, and smoke variables all have low p-values (p < 0.05), meaning they are all significant.

However, the age variable has a high p-value, meaning it is not significant. The age of the mother does not have a significant effect on the bwt.

####Is removing insignificant variables improving your model’s predictivity? The coefficients/p-values for gestation, parity, height, weight, and smoke remain similar to the previous summary.

The R-squared value and adjusted R-squared value are also quite similar, meaning that the removal of “age” did not have a big impact on the overall model.

#Multiple Linear Regression Model
mlr2 <- lm(bwt ~ gestation + parity + height + weight + smoke)

#Summary of Multiple Linear Regression Model
summary(mlr2)
## 
## Call:
## lm(formula = bwt ~ gestation + parity + height + weight + smoke)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -57.716 -10.150  -0.159   9.689  51.620 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -80.71321   14.04465  -5.747 1.16e-08 ***
## gestation     0.44408    0.02907  15.276  < 2e-16 ***
## parity       -3.28762    1.06281  -3.093  0.00203 ** 
## height        1.15497    0.20473   5.641 2.11e-08 ***
## weight        0.04983    0.02503   1.991  0.04672 *  
## smoke        -8.39390    0.95117  -8.825  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.82 on 1168 degrees of freedom
## Multiple R-squared:  0.2579, Adjusted R-squared:  0.2548 
## F-statistic:  81.2 on 5 and 1168 DF,  p-value: < 2.2e-16

###Task 4: Estimating baby weight (0.25 points) Use your best predicting model and full model to estimated a first born babies weight, whose mother is 25 years old, newer smoked, the gestation was 286 days, mother’s height is 62 inches and mother’s weight is 93 pounds

# bwt predicted

bwt_predicted = coef(mlr1)[1] + coef(mlr1)[2]*(age) + coef(mlr1)[3]*(gestation) + coef(mlr1)[4]*(height) +coef(mlr1)[5]*(weight)
print(bwt_predicted)
##    [1]  -936.7824  -923.4003  -916.6419  -924.8796  -944.6759  -797.1176
##    [7]  -803.3288  -953.0522  -978.9364 -1151.7773  -924.3961  -919.3636
##   [13]  -924.0091  -894.9883  -932.5668  -836.4653  -858.6468  -847.1572
##   [19]  -936.2645  -899.6967  -893.9779  -940.7784  -897.7952  -967.2646
##   [25]  -856.1927  -928.2326  -872.7762  -956.4639  -896.8450  -891.5487
##   [31]  -912.5577  -876.4454  -910.6707  -923.6673  -928.4000  -919.5718
##   [37]  -951.1144  -876.7077  -963.5393  -913.5784  -890.4025  -807.5964
##   [43]  -901.8547  -960.7101  -900.5536  -900.3077  -958.4096  -849.2142
##   [49]  -925.8093  -930.3364  -938.0485  -871.5127  -909.8605  -905.7736
##   [55]  -838.8154  -901.2446  -761.7565  -902.8698  -945.6380  -920.5333
##   [61]  -806.1385  -930.6030  -921.9176  -802.2467  -894.0201  -893.7417
##   [67]  -900.6154  -947.2973  -961.7869  -931.8001  -903.8390  -891.3835
##   [73]  -905.6726  -942.3756  -902.1781  -911.0337  -896.7055  -958.9106
##   [79]  -922.7408  -955.6080  -892.6685  -938.5585  -963.5196  -968.9579
##   [85]  -994.8254  -926.7461  -882.5012  -895.6361  -919.5986  -930.0398
##   [91]  -841.0036  -989.1219  -831.9143  -921.4009  -897.5352  -915.1629
##   [97]  -902.2678  -909.0839  -937.3269  -896.4327  -996.4370  -896.4514
##  [103]  -991.5118  -836.2694  -915.4927  -906.2665  -909.0877  -922.8040
##  [109]  -861.1450  -788.0658  -952.4266  -930.9548  -939.2643  -922.8373
##  [115]  -897.8025  -932.9889  -911.3042  -877.8847  -885.9791  -731.8556
##  [121]  -917.5566  -873.7289  -967.3801  -937.0951  -914.0605  -845.1879
##  [127]  -908.3172  -930.6189  -885.8755  -900.1148  -867.8867  -959.8914
##  [133]  -983.6146  -909.6516  -881.7288  -904.5655  -862.5078  -974.9810
##  [139]  -899.2388  -913.1034  -883.3088  -915.6806  -933.6688 -1047.6544
##  [145]  -923.6680  -950.2033  -960.2200  -946.4331  -891.1732  -850.4572
##  [151]  -973.0690  -953.2301  -949.1663  -949.9529  -987.7678  -970.5416
##  [157]  -898.6244  -886.5896  -943.8814  -919.4983  -912.6432  -900.7440
##  [163]  -870.7604  -919.7457  -946.6171  -954.3222  -938.1231  -907.1906
##  [169]  -892.1940  -905.4302 -1010.1364  -849.1563  -886.3843  -811.5688
##  [175]  -874.8279  -906.8453  -907.4018  -785.1444  -967.6044  -898.5162
##  [181]  -954.4002  -905.4108 -1053.3126  -957.6173  -883.9384  -903.8122
##  [187]  -932.2323  -933.4751  -929.4799  -942.9818  -921.1396  -913.8736
##  [193]  -892.3057  -811.9943  -888.5813  -859.9097  -926.6235  -954.6932
##  [199]  -760.4835  -938.6016  -763.6364  -900.7632  -954.5458  -905.9620
##  [205]  -940.2234  -905.3799  -861.9523  -940.9703  -877.0825  -836.5850
##  [211]  -932.4908  -903.8313  -812.1976  -952.4756  -956.6349 -1041.7594
##  [217]  -907.9183  -878.2759  -909.7834  -895.1591  -963.7396 -1080.7493
##  [223]  -912.2385  -942.0478  -897.7754  -918.2289  -905.2514  -855.1468
##  [229]  -921.0744  -902.4342  -861.6606  -943.8078  -933.4442 -1077.5750
##  [235]  -955.7544  -941.8362  -947.7876  -939.3268  -477.4674  -837.5729
##  [241]  -946.5131  -961.0542  -857.8492  -920.5676  -960.7205  -925.2333
##  [247]  -920.8028  -910.8131  -971.9458  -910.2775  -945.3169  -905.8657
##  [253]  -891.5985  -986.4865  -935.4248  -897.3631 -1004.3915 -1048.5655
##  [259]  -905.4370  -927.5876  -959.8331  -973.8530  -914.2419  -926.8715
##  [265]  -962.2194  -905.2955  -930.2415  -931.8998  -991.3660  -916.5101
##  [271]  -993.7750  -898.9459  -937.8369  -868.5506  -970.1577  -902.6844
##  [277]  -894.6251  -932.4827  -876.5266  -941.2065 -1011.0344  -961.3476
##  [283]  -950.8177  -939.8484  -839.9390 -1003.9214  -975.1199  -926.0361
##  [289]  -951.7753  -902.7118  -917.1051  -911.7161  -881.6669  -884.0076
##  [295]  -874.8667  -913.5084  -931.9004  -930.0482  -901.1138  -935.0195
##  [301]  -849.7002  -967.9815  -917.3257  -962.7042  -930.7149  -868.9229
##  [307]  -895.4822  -886.5543  -954.5578  -899.5934  -914.3964  -851.0472
##  [313]  -835.9054  -922.5903  -895.7330  -907.2586  -884.2195  -905.0629
##  [319]  -958.0040  -914.0290  -905.1096  -800.9420  -918.8366  -965.6934
##  [325]  -973.4598 -1016.9983  -911.0795  -922.3307  -911.6019  -952.9220
##  [331]  -883.2584  -914.7421  -935.0538  -944.9042  -926.3767  -765.3928
##  [337]  -896.0574  -940.6472  -993.2499  -932.6566  -955.4335  -964.3229
##  [343]  -897.0790  -963.6090  -969.3947  -919.8466 -1026.6706  -909.2933
##  [349]  -960.4282  -912.4852  -898.3187  -924.2852  -919.6762  -872.6206
##  [355]  -916.0171  -815.8922  -950.7547  -957.3250  -945.8070  -926.5353
##  [361]  -912.0612  -903.6615  -946.6340  -979.7287  -962.1079  -950.0967
##  [367]  -922.5706 -1033.6254  -951.0990  -951.0533  -814.6306  -982.7419
##  [373]  -926.0763  -944.0739  -862.8081 -1003.5195  -926.1259  -847.2772
##  [379]  -909.9018  -913.3766  -941.3420  -909.8872  -964.7238  -904.6417
##  [385]  -947.8229  -918.7891  -984.4370  -928.7733  -971.3286  -922.4441
##  [391]  -951.3343  -912.5049  -893.0430  -939.2696  -916.1723  -920.0889
##  [397]  -879.9430  -906.6223  -819.8686  -893.5536  -955.0042  -924.1461
##  [403]  -936.0187  -915.1107  -871.4680  -896.5749  -955.0590  -912.6666
##  [409]  -909.7952  -768.7097  -965.8819  -903.9777  -834.3878  -927.3808
##  [415]  -952.9058  -919.3368  -917.6809  -921.6879  -878.4437  -932.3485
##  [421]  -916.2138  -935.2463  -935.0877  -899.2802  -857.8019  -882.0587
##  [427]  -836.4333  -897.5473 -1066.6683  -927.2224  -724.5291  -932.1905
##  [433]  -890.3751  -883.7671  -908.5134  -838.1170  -935.1663  -993.4616
##  [439]  -970.4917  -918.0234  -904.1634  -883.3153  -918.1757  -834.5314
##  [445]  -881.4319  -955.0328  -963.6139  -852.7723  -915.1635  -791.6757
##  [451]  -928.0986  -894.6095  -878.1981  -920.1896  -911.0887  -955.7313
##  [457]  -949.7524  -959.0589  -955.9324  -964.8633  -908.1539  -916.1717
##  [463]  -952.6964  -937.0070  -820.4539  -765.3036  -869.0267  -877.6262
##  [469]  -933.7692  -935.6221  -955.2205  -889.5413  -926.3808  -887.0144
##  [475]  -945.1593  -813.1792  -859.7020  -953.0089  -942.5460  -922.0840
##  [481]  -876.9550  -945.6573  -927.7046  -917.8317  -888.4312  -933.1729
##  [487]  -918.8974  -785.3609  -938.1606  -942.9398  -951.3193  -961.2057
##  [493]  -897.8863  -930.3684  -898.9372  -981.2909  -946.2193  -930.9582
##  [499]  -983.1353  -910.1279  -902.2260  -893.1589  -933.0591  -908.3592
##  [505]  -957.0811  -887.3803  -898.5543  -913.9477  -963.9374  -921.1889
##  [511]  -990.4160  -917.2640  -959.5717  -988.6704  -903.7352  -958.6450
##  [517]  -928.5383  -901.1489  -939.5041  -913.8318  -865.1935  -959.2624
##  [523]  -938.2532  -861.7959  -897.5236  -986.1481  -851.5314  -912.4073
##  [529]  -973.1625  -924.0106  -876.2439  -828.8887  -882.0952  -859.1641
##  [535]  -898.9144  -948.3977  -938.6633  -856.8719  -954.0673  -836.5582
##  [541]  -895.0533  -890.7847  -841.4641  -928.8168  -967.5581  -941.4100
##  [547]  -944.9310  -921.1389  -932.5830  -988.8217 -1014.9691  -931.2599
##  [553]  -881.5946  -869.7648  -925.7087  -867.4124  -967.5534  -998.9002
##  [559]  -891.7419  -889.2799  -948.2751  -818.7330  -866.2940  -891.6964
##  [565]  -935.5211  -908.3050  -995.1942  -937.2774  -925.5162  -907.9386
##  [571]  -890.4200  -919.7808  -905.1084  -878.4449  -909.5475  -940.1522
##  [577]  -961.3507  -894.6332  -943.8554  -917.6996  -896.7369  -887.0413
##  [583]  -896.3543  -904.2210  -808.0685  -970.5599  -889.7812  -880.3041
##  [589]  -994.7193 -1019.0594  -896.9752  -920.0391  -766.8023  -911.3237
##  [595]  -959.3417  -956.7872  -957.6348  -847.1405  -881.7713  -921.9073
##  [601]  -941.5922  -900.2301  -910.0563  -910.5237  -937.8681  -944.2468
##  [607]  -949.2339  -813.5757  -887.5274  -902.2035  -960.3319  -866.6185
##  [613] -1003.3410  -903.5500  -959.0851  -900.9405  -928.2215  -866.7030
##  [619]  -972.4325  -922.2083  -824.1676  -974.6979  -948.9845  -903.7309
##  [625]  -824.4249  -918.3857  -900.7639  -974.8606  -906.9270  -932.9535
##  [631]  -950.0528  -834.1136  -908.8371  -899.8554  -916.6344  -881.8909
##  [637]  -993.1173  -930.2978  -924.8488  -966.8517  -836.5214 -1039.5551
##  [643]  -883.0443  -903.7614  -878.1939  -882.7409  -900.5005  -961.8639
##  [649]  -985.4677  -974.6122  -887.8745  -929.0205  -924.2803  -915.5071
##  [655]  -778.8186  -967.8672  -880.7040  -887.6009  -927.0360  -845.0059
##  [661]  -975.4400  -896.9752  -946.4866  -978.2036  -751.8801  -965.8096
##  [667]  -938.3617  -899.0870  -939.8120 -1017.4110  -916.6468  -931.0552
##  [673]  -987.2698  -889.8977  -923.1383  -980.2651  -887.1453  -908.5254
##  [679]  -903.2707  -911.1216  -797.3381  -943.1490  -835.8829  -921.9796
##  [685]  -933.2675  -941.1600  -899.8980  -911.3696  -909.2313  -887.0937
##  [691]  -976.4468  -890.9624  -951.6362  -927.9828  -886.8744  -925.9187
##  [697]  -916.8899  -878.5533  -939.3378 -1041.6438  -948.0196  -947.4740
##  [703]  -866.9731  -896.2820  -906.7795  -906.0274  -899.7083  -934.7138
##  [709]  -950.0219  -917.3824  -951.3072  -926.9216  -910.7128 -1082.9127
##  [715]  -905.7928  -926.3306  -919.2434  -932.8229  -956.2252  -958.4055
##  [721] -1050.6493  -956.8577  -888.6499  -912.0569  -942.1749  -922.0687
##  [727]  -934.8521  -937.1269  -988.0761 -1029.2573  -905.5682  -831.0955
##  [733]  -952.6974  -928.6190  -984.5517  -808.2765  -878.5792  -932.0546
##  [739]  -898.0327  -827.6530  -929.3060  -892.9276  -913.2190  -938.8256
##  [745]  -920.5175  -943.8807  -919.1053  -939.4627  -943.4260  -884.7721
##  [751]  -906.0315  -890.8661  -915.3760  -919.0113  -950.8747  -891.2094
##  [757]  -905.8988  -961.8418  -934.8491  -883.1215  -840.8883 -1002.9184
##  [763]  -904.7158  -879.4559  -906.6918  -922.3665  -911.7506  -917.1746
##  [769]  -935.2579  -950.3999  -935.7364  -862.3268  -949.5272  -881.8948
##  [775]  -900.8819  -887.6324  -983.4261  -926.8702  -957.7759  -784.2026
##  [781]  -752.5940  -805.5117  -900.6418  -928.7390  -737.8426  -927.6463
##  [787]  -923.6278  -940.7112  -823.0790  -878.5615  -927.4538  -859.0305
##  [793] -1007.8113  -933.1700  -962.1428  -938.0566  -911.5861  -922.3226
##  [799]  -866.0391  -879.7698  -880.5336  -970.7543 -1010.2736  -966.6963
##  [805]  -912.4469  -934.2546  -926.6113  -952.0858  -944.6760  -940.2386
##  [811]  -875.7595  -940.6202  -935.6903  -927.6741  -933.9309  -890.4929
##  [817]  -966.1753  -903.7643  -967.7512  -590.1173  -933.4597  -927.8510
##  [823]  -934.4437  -975.9400  -964.3087 -1012.2006  -887.8121  -890.7077
##  [829]  -869.8109  -894.6302  -907.2245  -926.7390  -904.7379  -957.3135
##  [835]  -947.2390  -978.8054  -873.5658  -932.6454  -858.2780  -939.5356
##  [841]  -898.1733  -929.1787  -947.4176  -922.1197  -916.4957  -946.3708
##  [847]  -831.7417  -923.8907  -906.7450  -962.4543  -926.1062  -887.5491
##  [853]  -922.8145  -953.2419  -896.1508  -879.8729  -902.8928 -1007.8817
##  [859]  -914.9172  -798.7964  -873.3923  -914.0339  -914.2605  -923.7356
##  [865]  -913.7745  -928.5343  -878.2091  -929.5020  -923.7906  -906.1205
##  [871]  -945.9978  -950.6940  -936.7405  -771.3215  -922.2120  -889.8931
##  [877]  -882.2544  -881.9644  -957.8535  -900.4202  -940.4189  -908.4214
##  [883]  -829.6645  -864.5386  -932.4431 -1007.8421  -890.5150  -923.7368
##  [889]  -895.6021  -874.3179  -890.5499  -958.2270  -946.2010  -955.1746
##  [895]  -857.6250  -936.0736  -926.0063  -873.9251 -1038.9188  -936.0567
##  [901]  -955.9610  -973.5794  -895.5200  -965.4007  -954.8440  -973.2865
##  [907]  -886.8441  -941.9013  -844.6081  -889.1170  -929.1789  -929.5995
##  [913]  -891.9152  -919.0667 -1088.6994 -1007.3265  -960.8301  -919.1867
##  [919]  -936.7749  -922.2999  -974.3430  -894.4160  -661.5859  -910.1045
##  [925]  -932.1553  -885.0339  -944.5334  -922.6945  -933.8608  -950.1416
##  [931]  -973.7987  -907.7719  -931.5148  -927.7513  -890.6882  -870.3818
##  [937]  -963.6866  -930.0017  -925.6039  -847.6576  -896.5113  -909.2626
##  [943]  -928.6072  -887.7981  -926.9637  -900.4572 -1068.8797  -904.7529
##  [949]  -898.1461  -916.1823  -995.8045  -902.7112  -928.9214  -882.3395
##  [955]  -940.7859  -909.8475  -912.6706  -839.2600  -846.2386  -950.9781
##  [961]  -910.2117  -819.3413  -909.2543  -806.3688  -964.0108  -889.1820
##  [967]  -941.0124  -804.1817  -952.3537 -1026.9466 -1002.6088  -934.1920
##  [973]  -835.1218  -940.7626  -967.6509  -909.8410  -872.8860  -959.6446
##  [979]  -771.3530  -946.5365  -904.7688  -959.8079  -947.6830  -931.1670
##  [985]  -876.7768  -972.9734 -1005.3334  -920.6377  -941.9671  -873.6970
##  [991]  -932.6799  -951.6159  -937.7485  -924.5238  -949.7721  -908.9385
##  [997]  -890.5570  -879.9734  -905.9807  -951.1187  -890.5611  -862.9621
## [1003]  -894.2858  -936.7596  -925.1451  -906.8845  -877.5504  -759.2297
## [1009]  -920.1009  -929.4823  -925.0565  -887.8984  -914.0773  -881.4778
## [1015] -1024.1298  -892.3912 -1037.5956  -957.4481  -950.4668  -924.2303
## [1021]  -990.9600  -933.1467  -915.5386  -895.6717  -963.6663  -952.6937
## [1027]  -902.5099  -957.2942  -871.5506  -895.4093  -913.0218  -964.3458
## [1033]  -943.9543  -951.7932  -952.8934  -836.7897  -917.2668  -950.6438
## [1039]  -909.1042  -928.5342  -912.7592  -924.8322  -909.1855  -909.6475
## [1045]  -893.4549  -874.8273  -930.1678  -935.8268  -929.2979  -915.2265
## [1051]  -958.4937  -913.9670  -902.9517  -933.6071  -896.3976  -900.6897
## [1057]  -883.1075  -974.4137  -923.6972  -924.3575  -925.5850  -895.8411
## [1063]  -873.1060  -908.3149  -945.4637  -951.0224  -980.1777  -928.1607
## [1069]  -898.2499  -924.0866  -938.9353  -895.0370  -937.2148  -830.2897
## [1075]  -975.9557  -919.9276  -812.9976  -915.2009  -938.2333  -907.3902
## [1081]  -944.1708  -783.0750 -1050.1779  -878.9693  -780.0612  -930.1061
## [1087]  -918.5374  -916.8503  -806.4960  -985.5522  -868.1481  -872.9549
## [1093]  -937.1098  -861.0123  -736.6965  -887.6346  -929.1915  -954.9752
## [1099]  -889.2637  -966.1831  -854.2946  -955.6815  -882.8688  -868.0664
## [1105]  -954.1552  -932.6799  -857.5287  -887.7467 -1015.8051  -873.7208
## [1111]  -966.1788  -839.4148  -886.8951  -922.4248 -1164.8966  -920.5321
## [1117]  -948.0547  -959.3209  -909.7482  -794.5402  -899.3762  -903.0361
## [1123]  -890.9579  -884.6641  -985.2471  -905.1289  -966.0472  -905.6726
## [1129]  -989.2647  -845.8671  -919.1936 -1029.5201  -954.9327  -889.8157
## [1135]  -979.9948  -903.8384  -922.8267  -983.2474 -1114.1834  -841.0083
## [1141]  -930.8399  -980.9272  -855.9110  -898.5580  -873.0446  -800.8780
## [1147]  -811.8016  -932.3357  -927.7204  -891.3983  -872.6169  -935.0654
## [1153]  -877.5645  -968.0865  -877.7732 -1045.9169  -939.9991 -1050.8155
## [1159]  -942.8931  -954.9441  -949.6444  -861.2459  -921.1389  -934.3864
## [1165]  -805.1039  -918.4474  -903.9462  -952.2300  -885.4352  -909.1456
## [1171]  -868.1241  -952.7705  -925.5009  -970.2353
predict(mlr1, data.frame(parity = 1, age = 25, smoke = 0, gestation = 286, height = 62, weight = 93), interval = "confidence")
##        fit      lwr      upr
## 1 119.2306 116.7872 121.6741

Compare your calculated baby weight estimate to the actual value as obtained from the data file.

At the age of 25, the data file says the baby weight should be 136, whereas the predication model estimates it to be approximately 119 pounds.