Data for the VIBASS session on linear models. This is a simulated dataset that includes data about children. The variables in the dataset are:

data("Weights")

Format

An object of class "data.frame".

Source

VIBASS Team.

Details

  • age. Age (in years).

  • vegetables. Measure of vegetables consumption.

  • weight. Weight (in kg).

  • sex. Girl or Boy.

  • height. Height (in cm).

  • ethnicity Asian, Black or European.

Examples

data(Weights)
summary(Weights)
#>       age           vegetables          weight        sex         height     
#>  Min.   : 5.094   Min.   :0.06729   Min.   :10.95   Girl:48   Min.   :124.3  
#>  1st Qu.: 7.262   1st Qu.:0.16413   1st Qu.:17.03   Boy :52   1st Qu.:139.1  
#>  Median : 8.415   Median :0.21630   Median :19.44             Median :149.5  
#>  Mean   : 8.625   Mean   :0.22745   Mean   :19.47             Mean   :150.4  
#>  3rd Qu.:10.370   3rd Qu.:0.28416   3rd Qu.:22.27             3rd Qu.:161.7  
#>  Max.   :11.943   Max.   :0.47274   Max.   :27.54             Max.   :177.4  
#>   ethnicity        
#>  Length:100        
#>  Class :character  
#>  Mode  :character  
#>                    
#>                    
#>                    

# ML estimates
lmW <- lm(weight ~ age, data = Weights)
summary(lmW)
#> 
#> Call:
#> lm(formula = weight ~ age, data = Weights)
#> 
#> Residuals:
#>     Min      1Q  Median      3Q     Max 
#> -5.2074 -1.4716 -0.2041  1.4890  4.3523 
#> 
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)   8.4838     1.0373   8.179 1.05e-12 ***
#> age           1.2735     0.1176  10.833  < 2e-16 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> Residual standard error: 2.191 on 98 degrees of freedom
#> Multiple R-squared:  0.5449,	Adjusted R-squared:  0.5403 
#> F-statistic: 117.4 on 1 and 98 DF,  p-value: < 2.2e-16
#>