Skip to content

Commit fc600d2

Browse files
committed
update website
1 parent 62045c3 commit fc600d2

20 files changed

+267
-209
lines changed
Binary file not shown.
616 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Discussion questions
22

3-
1. Linear regression can answer research questions typically reserved for specialty statistics like the t-test and ANOVA. For example, Pearson correlation coefficient has the form of $r = \frac{COV[X,Y]}{STD[X]STD[Y]}$, how does this compare to the ordinary least squares solution for $\hat{\beta}$? Provide a quantitative comparison of the two methods.
3+
1. Linear regression can answer research questions typically reserved for specialty statistics like the t-test and ANOVA. For example, Pearson correlation coefficient has the form of $r = \frac{COV[X,Y]}{STD[X]STD[Y]}$, how does this compare to the ordinary least squares solution for $\hat{\beta}$? Provide a quantitative comparison of the two methods. Note: The unstandardized beta (B) represents the change in Y for a one-unit change in X. The standardized beta (β) represents the change in Y in standard deviation units for a one standard deviation change in X.
44

55
2. Provide an explanation for why polynomial models still meet the assumptions of normal linear regression. Justify against each of the 4 assumptions for ordinary least squares regression.
66

book/_build/html/_sources/exercises/linear-models.ipynb

+15-11
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"id": "3EgzqKyDJN6V"
202202
},
203203
"source": [
204-
"**DUE:** 5pm EST, February 26, 2024"
204+
"**DUE:** 5pm EST, February 24, 2025"
205205
]
206206
},
207207
{
@@ -220,19 +220,23 @@
220220
"provenance": []
221221
},
222222
"kernelspec": {
223-
"display_name": "R",
224-
"language": "R",
225-
"name": "ir"
223+
"display_name": "Python 3 (ipykernel)",
224+
"language": "python",
225+
"name": "python3"
226226
},
227227
"language_info": {
228-
"codemirror_mode": "r",
229-
"file_extension": ".r",
230-
"mimetype": "text/x-r-source",
231-
"name": "R",
232-
"pygments_lexer": "r",
233-
"version": "4.2.0"
228+
"codemirror_mode": {
229+
"name": "ipython",
230+
"version": 3
231+
},
232+
"file_extension": ".py",
233+
"mimetype": "text/x-python",
234+
"name": "python",
235+
"nbconvert_exporter": "python",
236+
"pygments_lexer": "ipython3",
237+
"version": "3.12.7"
234238
}
235239
},
236240
"nbformat": 4,
237-
"nbformat_minor": 1
241+
"nbformat_minor": 4
238242
}

book/_build/html/_sources/exercises/the-ordinary-least-squares-solution.ipynb

+15-11
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"id": "xcnXbsZvDF6B"
158158
},
159159
"source": [
160-
"**DUE:** 5pm EST, Feb 28, 2024"
160+
"**DUE:** 5pm EST, Feb 26, 2025"
161161
]
162162
},
163163
{
@@ -176,19 +176,23 @@
176176
"provenance": []
177177
},
178178
"kernelspec": {
179-
"display_name": "R",
180-
"language": "R",
181-
"name": "ir"
179+
"display_name": "Python 3 (ipykernel)",
180+
"language": "python",
181+
"name": "python3"
182182
},
183183
"language_info": {
184-
"codemirror_mode": "r",
185-
"file_extension": ".r",
186-
"mimetype": "text/x-r-source",
187-
"name": "R",
188-
"pygments_lexer": "r",
189-
"version": "4.2.0"
184+
"codemirror_mode": {
185+
"name": "ipython",
186+
"version": 3
187+
},
188+
"file_extension": ".py",
189+
"mimetype": "text/x-python",
190+
"name": "python",
191+
"nbconvert_exporter": "python",
192+
"pygments_lexer": "ipython3",
193+
"version": "3.12.7"
190194
}
191195
},
192196
"nbformat": 4,
193-
"nbformat_minor": 1
197+
"nbformat_minor": 4
194198
}

book/_build/html/discussions/linear-models.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ <h1>Discussion questions</h1>
546546
<section class="tex2jax_ignore mathjax_ignore" id="discussion-questions">
547547
<h1>Discussion questions<a class="headerlink" href="#discussion-questions" title="Link to this heading">#</a></h1>
548548
<ol class="arabic simple">
549-
<li><p>Linear regression can answer research questions typically reserved for specialty statistics like the t-test and ANOVA. For example, Pearson correlation coefficient has the form of <span class="math notranslate nohighlight">\(r = \frac{COV[X,Y]}{STD[X]STD[Y]}\)</span>, how does this compare to the ordinary least squares solution for <span class="math notranslate nohighlight">\(\hat{\beta}\)</span>? Provide a quantitative comparison of the two methods.</p></li>
549+
<li><p>Linear regression can answer research questions typically reserved for specialty statistics like the t-test and ANOVA. For example, Pearson correlation coefficient has the form of <span class="math notranslate nohighlight">\(r = \frac{COV[X,Y]}{STD[X]STD[Y]}\)</span>, how does this compare to the ordinary least squares solution for <span class="math notranslate nohighlight">\(\hat{\beta}\)</span>? Provide a quantitative comparison of the two methods. Note: The unstandardized beta (B) represents the change in Y for a one-unit change in X. The standardized beta (β) represents the change in Y in standard deviation units for a one standard deviation change in X.</p></li>
550550
<li><p>Provide an explanation for why polynomial models still meet the assumptions of normal linear regression. Justify against each of the 4 assumptions for ordinary least squares regression.</p></li>
551551
</ol>
552552
</section>

book/_build/html/exercises/linear-models.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ <h2>1. Loading the Data (1 point)<a class="headerlink" href="#loading-the-data-1
619619
<p>Use the <code class="docutils literal notranslate"><span class="pre">head</span></code> function to look at the first few rows of each data frame.</p>
620620
<div class="cell docutils container">
621621
<div class="cell_input docutils container">
622-
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="c1"># If you are running this on your local computer, wet your workign directory to </span>
622+
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># If you are running this on your local computer, wet your workign directory to </span>
623623
<span class="c1"># the location of the lexDat data by setting your harddrive. Uncomment this line</span>
624624
<span class="c1"># and change the location to where it is on your computer. </span>
625625
<span class="c1">#setwd(&quot;~/Documents/PittCMU/G3/DSPN/DataSciencePsychNeuro/Homeworks/hcp_data&quot;)</span>
@@ -639,7 +639,7 @@ <h2>2. Initial data visualization (2 point)<a class="headerlink" href="#initial-
639639
<p>Use the <code class="docutils literal notranslate"><span class="pre">pairs</span></code> function to look at all the pairwise scatterplots of the variables in <code class="docutils literal notranslate"><span class="pre">d1</span></code>. Describe which variables seem positively correlated, negatively correlated, or not correlated at all.</p>
640640
<div class="cell docutils container">
641641
<div class="cell_input docutils container">
642-
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="c1">#INSERT CODE HERE</span>
642+
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1">#INSERT CODE HERE</span>
643643
</pre></div>
644644
</div>
645645
</div>
@@ -659,7 +659,7 @@ <h2>3. Linear regression (4 points)<a class="headerlink" href="#linear-regressio
659659
<p>Show the results using the <code class="docutils literal notranslate"><span class="pre">summary</span></code> function, and report the mean coefficient values for <span class="math notranslate nohighlight">\(beta_0\)</span> &amp; <span class="math notranslate nohighlight">\(\beta_1\)</span> (<code class="docutils literal notranslate"><span class="pre">coef</span></code> function) and their 95% confidence intervals (<code class="docutils literal notranslate"><span class="pre">confint</span></code> function). Is grey matter volume significantly associated with Flanker Task performance?</p>
660660
<div class="cell docutils container">
661661
<div class="cell_input docutils container">
662-
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="c1">#INSERT CODE HERE</span>
662+
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1">#INSERT CODE HERE</span>
663663
</pre></div>
664664
</div>
665665
</div>
@@ -674,7 +674,7 @@ <h2>4. Plotting (2 points)<a class="headerlink" href="#plotting-2-points" title=
674674
<p>Use <code class="docutils literal notranslate"><span class="pre">ggplot</span></code> to plot the <code class="docutils literal notranslate"><span class="pre">FS_Total_GM_Vol</span></code> variable (x axis) against the <code class="docutils literal notranslate"><span class="pre">Flanker_Unadj</span></code> variable (y axis), as well as the regression line with confidence intervals on the regrssion line. Qualitatively describe what you see.</p>
675675
<div class="cell docutils container">
676676
<div class="cell_input docutils container">
677-
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="c1">#INSERT CODE HERE</span>
677+
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1">#INSERT CODE HERE</span>
678678
</pre></div>
679679
</div>
680680
</div>
@@ -690,7 +690,7 @@ <h2>5. Reflection (1 point)<a class="headerlink" href="#reflection-1-point" titl
690690
<blockquote>
691691
<div><p><em>Write your response here.</em></p>
692692
</div></blockquote>
693-
<p><strong>DUE:</strong> 5pm EST, February 26, 2024</p>
693+
<p><strong>DUE:</strong> 5pm EST, February 24, 2025</p>
694694
<p><strong>IMPORTANT</strong> Did you collaborate with anyone on this assignment? If so, list their names here.</p>
695695
<blockquote>
696696
<div><p><em>Someone’s Name</em></p>
@@ -707,16 +707,16 @@ <h2>5. Reflection (1 point)<a class="headerlink" href="#reflection-1-point" titl
707707
},
708708
codeMirrorConfig: {
709709
theme: "abcdef",
710-
mode: "r"
710+
mode: "python"
711711
},
712712
kernelOptions: {
713-
name: "ir",
713+
name: "python3",
714714
path: "./exercises"
715715
},
716716
predefinedOutput: true
717717
}
718718
</script>
719-
<script>kernelName = 'ir'</script>
719+
<script>kernelName = 'python3'</script>
720720

721721
</article>
722722

book/_build/html/exercises/the-ordinary-least-squares-solution.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -643,20 +643,20 @@ <h2>2. Connecting to data (4 points)<a class="headerlink" href="#connecting-to-d
643643
<p>Use the <code class="docutils literal notranslate"><span class="pre">head</span></code> function to look at the first few rows of each data frame.</p>
644644
<div class="cell docutils container">
645645
<div class="cell_input docutils container">
646-
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="c1"># WRITE YOUR CODE HERE</span>
646+
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># WRITE YOUR CODE HERE</span>
647647
</pre></div>
648648
</div>
649649
</div>
650650
</div>
651651
<p>b) Now we’re going to see if the solutions we proved above actually line up with the model fit that R gives us (it should…). Calculate what the <span class="math notranslate nohighlight">\(\beta_0\)</span> and <span class="math notranslate nohighlight">\(\beta_1\)</span> coefficients should be for a simple linear regression model using <code class="docutils literal notranslate"><span class="pre">Flanker_Unadj</span></code> as <span class="math notranslate nohighlight">\(Y\)</span> and <code class="docutils literal notranslate"><span class="pre">FS_Total_GM_Vol</span></code> as <span class="math notranslate nohighlight">\(X\)</span>. Use the formulas we derived above (<span class="math notranslate nohighlight">\(\beta_1 = Cov[XY]/Var[X]\)</span> , <span class="math notranslate nohighlight">\(\beta_0 = E[Y] - \beta_1E[X]\)</span>). Then use <code class="docutils literal notranslate"><span class="pre">lm()</span></code> to compare the coefficients you calculated with the ones R gives you.</p>
652652
<div class="cell docutils container">
653653
<div class="cell_input docutils container">
654-
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="c1"># WRITE YOUR CODE HERE</span>
654+
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># WRITE YOUR CODE HERE</span>
655655
</pre></div>
656656
</div>
657657
</div>
658658
</div>
659-
<p><strong>DUE:</strong> 5pm EST, Feb 28, 2024</p>
659+
<p><strong>DUE:</strong> 5pm EST, Feb 26, 2025</p>
660660
<p><strong>IMPORTANT</strong> Did you collaborate with anyone on this assignment? If so, list their names here.</p>
661661
<blockquote>
662662
<div><p><em>Someone’s Name</em></p>
@@ -673,16 +673,16 @@ <h2>2. Connecting to data (4 points)<a class="headerlink" href="#connecting-to-d
673673
},
674674
codeMirrorConfig: {
675675
theme: "abcdef",
676-
mode: "r"
676+
mode: "python"
677677
},
678678
kernelOptions: {
679-
name: "ir",
679+
name: "python3",
680680
path: "./exercises"
681681
},
682682
predefinedOutput: true
683683
}
684684
</script>
685-
<script>kernelName = 'ir'</script>
685+
<script>kernelName = 'python3'</script>
686686

687687
</article>
688688

book/_build/html/searchindex.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

book/_build/jupyter_execute/exercises/linear-models.ipynb

+15-11
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"id": "3EgzqKyDJN6V"
202202
},
203203
"source": [
204-
"**DUE:** 5pm EST, February 26, 2024"
204+
"**DUE:** 5pm EST, February 24, 2025"
205205
]
206206
},
207207
{
@@ -220,19 +220,23 @@
220220
"provenance": []
221221
},
222222
"kernelspec": {
223-
"display_name": "R",
224-
"language": "R",
225-
"name": "ir"
223+
"display_name": "Python 3 (ipykernel)",
224+
"language": "python",
225+
"name": "python3"
226226
},
227227
"language_info": {
228-
"codemirror_mode": "r",
229-
"file_extension": ".r",
230-
"mimetype": "text/x-r-source",
231-
"name": "R",
232-
"pygments_lexer": "r",
233-
"version": "4.2.0"
228+
"codemirror_mode": {
229+
"name": "ipython",
230+
"version": 3
231+
},
232+
"file_extension": ".py",
233+
"mimetype": "text/x-python",
234+
"name": "python",
235+
"nbconvert_exporter": "python",
236+
"pygments_lexer": "ipython3",
237+
"version": "3.12.7"
234238
}
235239
},
236240
"nbformat": 4,
237-
"nbformat_minor": 1
241+
"nbformat_minor": 4
238242
}

0 commit comments

Comments
 (0)