This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from IPython.core.interactiveshell import InteractiveShell | |
| InteractiveShell.ast_node_interactivity = "all" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ggplot(height, aes(x=fheight, y=sheight)) + | |
| geom_point(size=0.2) + | |
| stat_smooth(method = lm) + | |
| xlab("Father's height") + | |
| ylab("Son's height") + | |
| ggtitle("Son's height vs. Father's height") + | |
| theme(plot.title = element_text(hjust = 0.5)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plot(height, | |
| main = "Son height vs. Father height", | |
| xlab = "Father height", | |
| ylab = "Son height") | |
| abline(lm(height$sheight ~ height$fheight, data = height)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ggplot(height, aes(height$fheight, mod$residuals)) + | |
| geom_point(size=0.5) + | |
| ggtitle("Residual plot of estimates") + | |
| theme(plot.title = element_text(hjust = 0.5)) + | |
| xlab("Father height") + | |
| ylab("Son height") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plot(height$fheight, resid(mod), | |
| main = "Residual plot of estimates", | |
| xlab = "Father height", | |
| ylab = "Residual of son height estimate") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plot(density(resid(mod)), | |
| main = "Density plot of residuals") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ggplot(mod, aes(x=mod$residuals)) + | |
| geom_density(fill="blue", colour=NA, alpha=.2) + | |
| geom_line(stat = "density") + | |
| expand_limits(y = 0) + | |
| ggtitle("Density plot of residuals") + | |
| theme(plot.title = element_text(hjust = 0.5)) + | |
| xlab("Residual") + | |
| ylab("Density") |
NewerOlder