-
-
Save njg/cb5dec9a94b56f5cb350477969ccdbd6 to your computer and use it in GitHub Desktop.
This file contains 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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Regression questions\n", | |
"\n", | |
"consider the response variable (price) and independent variable (bore). " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## r.1" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"load imports-85\n", | |
"ds = dataset(X(:,7),X(:,8),X(:,9),X(:,15),'Varnames',{'curb_weight','engine_size','bore','price'});\n", | |
"\n", | |
"mdl=fitlm(ds,'price~bore');" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## r.1.1 (5 pts) plot the regression of price vs. bore" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## r.1.2 (10 pts) for the same model, what the $p$-value and $t$ statistic for $$H_1: \\beta_1=0$$" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## r.1.3 (10 pts) for the same model, what are the $p$-value and $t$ statistic for $$H_1: \\beta_1=100$$" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## r.1.4 (10 pts) Are the data consistent with the assumptions of the model? " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## r.2 " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"mdl=fitlm(ds,'bore~engine_size');" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## r.2.1 (5 pts) plot the regression of bore vs. engine_size" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## r.2.2 (10 pts) for the same model, what the $p$-value and $t$ statistic for $$H_1: \\beta_1=0$$" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## r.2.3 (10 pts) Are the data consistent with the assumptions of the model? " | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Matlab", | |
"language": "matlab", | |
"name": "matlab" | |
}, | |
"language_info": { | |
"codemirror_mode": "octave", | |
"file_extension": ".m", | |
"help_links": [ | |
{ | |
"text": "MetaKernel Magics", | |
"url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" | |
} | |
], | |
"mimetype": "text/x-matlab", | |
"name": "matlab", | |
"version": "0.14.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment