Call:
lm(formula = tchests ~ sword.time + parrots + tattoos, data = pirate_sub)
Residuals:
Min 1Q Median 3Q Max
-38.04 -16.17 -7.69 7.64 123.02
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.903 2.927 5.77 1.1e-08 ***
sword.time 0.357 0.882 0.40 0.6861
parrots 0.658 0.247 2.66 0.0079 **
tattoos 0.391 0.256 1.53 0.1264
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 24.4 on 917 degrees of freedom
Multiple R-squared: 0.00977, Adjusted R-squared: 0.00653
F-statistic: 3.02 on 3 and 917 DF, p-value: 0.0292
Conclusion: each additional parrot owned over a lifetime increases the estimated number of treasure chests acquired by an average of 0.658. This difference is statistically significant when controlling for the effect of sword draw time and tattoos.
Let’s go back a minute…
A data frame containing 1,000 rows and 14 columns
id An integer giving the pirate's id number
sex A string with the pirate's self reported sex
age An integer giving the age of the pirate in years
tattoos An integer indicating the number of tattoos the pirate has
tchests An integer indicating the number of treasure chests found by the pirate
parrots An integer indicating the number of parrots owned by the pirate in his/her lifetime
sword.time A number indicating how long it takes (in seconds) for the pirate to draw his/her sword.
beard.length A number indicating length of the pirate's beard in centimeters
grogg How many mugs of grogg the pirate drinks a day on average.
Call:
lm(formula = tchests ~ tattoos + parrots + beard.length + grogg,
data = male_pirates)
Residuals:
Min 1Q Median 3Q Max
-26.59 -14.22 -6.25 6.59 117.69
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14.2673 4.9979 2.85 0.0045 **
tattoos -0.0961 0.3515 -0.27 0.7848
parrots 0.6865 0.3409 2.01 0.0446 *
beard.length 0.4109 0.2056 2.00 0.0462 *
grogg -0.3035 0.3275 -0.93 0.3546
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 22.4 on 485 degrees of freedom
Multiple R-squared: 0.0198, Adjusted R-squared: 0.0117
F-statistic: 2.45 on 4 and 485 DF, p-value: 0.0452
Let’s go back a minute…
A data frame containing 1,000 rows and 14 columns
id An integer giving the pirate's id number
sex A string with the pirate's self reported sex
age An integer giving the age of the pirate in years
tattoos An integer indicating the number of tattoos the pirate has
tchests An integer indicating the number of treasure chests found by the pirate
parrots An integer indicating the number of parrots owned by the pirate in his/her lifetime
sword.time A number indicating how long it takes (in seconds) for the pirate to draw his/her sword.
beard.length A number indicating length of the pirate's beard in centimeters
grogg How many mugs of grogg the pirate drinks a day on average.
Age is related to:
Number of parrots owned in his/her lifetime
Number of tattoos (once added, they don’t go away by themselves)
Number of treasure chests found
Male Pirate Success Factors
reg3 <-lm(tchests ~ age + parrots + beard.length, data = male_pirates)summary(reg3)
Call:
lm(formula = tchests ~ age + parrots + beard.length, data = male_pirates)
Residuals:
Min 1Q Median 3Q Max
-27.96 -14.70 -6.04 6.43 118.71
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -5.943 5.841 -1.02 0.30937
age 0.702 0.192 3.65 0.00029 ***
parrots 0.504 0.340 1.48 0.13879
beard.length 0.372 0.169 2.20 0.02832 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 22.1 on 486 degrees of freedom
Multiple R-squared: 0.0442, Adjusted R-squared: 0.0383
F-statistic: 7.49 on 3 and 486 DF, p-value: 6.56e-05
Once we account for age, parrots is no longer that useful!
Male Pirate Success Factors
Call:
lm(formula = tchests ~ age + beard.length, data = male_pirates)
Residuals:
Min 1Q Median 3Q Max
-27.84 -14.37 -6.10 7.01 117.89
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -5.606 5.843 -0.96 0.338
age 0.747 0.190 3.94 9.4e-05 ***
beard.length 0.365 0.169 2.16 0.032 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 22.1 on 487 degrees of freedom
Multiple R-squared: 0.0399, Adjusted R-squared: 0.0359
F-statistic: 10.1 on 2 and 487 DF, p-value: 4.99e-05