Skip to content

Commit 554e49a

Browse files
committed
first draft of errorbar3
1 parent a31550a commit 554e49a

4 files changed

Lines changed: 222 additions & 1 deletion

File tree

‎docs/activities.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ <h5 class="no-anchor card-title listing-title">
700700
</div>
701701
</div></a>
702702
</div>
703-
<div class="g-col-1" data-index="13" data-categories="QWxsJTIwQWdlcyUyQ0RhdGElMjBTY2llbmNlJTJDU3ByZWFkc2hlZXRz" data-listing-file-modified-sort="1781453429983" data-listing-reading-time-sort="3" data-listing-word-count-sort="521">
703+
<div class="g-col-1" data-index="13" data-categories="QWxsJTIwQWdlcyUyQ0RhdGElMjBTY2llbmNlJTJDU3ByZWFkc2hlZXRz" data-listing-file-modified-sort="1781469425044" data-listing-reading-time-sort="7" data-listing-word-count-sort="1271">
704704
<a href="./projects/errorbar3.html" class="quarto-grid-link">
705705
<div class="quarto-grid-item card h-100 card-left">
706706
<p class="card-img-top">

‎docs/projects/errorbar3.html‎

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ <h2 id="toc-title">On this page</h2>
147147
<ul class="collapse">
148148
<li><a href="#the-problem" id="toc-the-problem" class="nav-link" data-scroll-target="#the-problem">The problem</a></li>
149149
<li><a href="#solution-calculate-the-error-on-the-mean" id="toc-solution-calculate-the-error-on-the-mean" class="nav-link" data-scroll-target="#solution-calculate-the-error-on-the-mean">Solution: Calculate the error on the mean</a></li>
150+
<li><a href="#new-species-vermicious-knids" id="toc-new-species-vermicious-knids" class="nav-link" data-scroll-target="#new-species-vermicious-knids">New species: Vermicious Knids</a>
151+
<ul class="collapse">
152+
<li><a href="#task-calculate-the-average-size-and-the-error-on-the-mean" id="toc-task-calculate-the-average-size-and-the-error-on-the-mean" class="nav-link" data-scroll-target="#task-calculate-the-average-size-and-the-error-on-the-mean">Task: Calculate the average size and the error on the mean</a></li>
153+
</ul></li>
154+
<li><a href="#two-new-species-snozzwanglers-and-hornswagglers" id="toc-two-new-species-snozzwanglers-and-hornswagglers" class="nav-link" data-scroll-target="#two-new-species-snozzwanglers-and-hornswagglers">Two new species: Snozzwanglers and Hornswagglers</a>
155+
<ul class="collapse">
156+
<li><a href="#advice" id="toc-advice" class="nav-link" data-scroll-target="#advice">Advice</a></li>
157+
</ul></li>
150158
</ul></li>
151159
</ul>
152160
</nav>
@@ -206,8 +214,96 @@ <h2 class="anchored" data-anchor-id="solution-calculate-the-error-on-the-mean">S
206214
<li>Take the result from dividing by the number of measurements and take the square root</li>
207215
</ul>
208216
<p><b>Done!</b> You have calculated the error on the mean! If you just did this calculation for the male specimens, now do the calculation for the female specimens!</p>
217+
</section>
218+
<section id="new-species-vermicious-knids" class="level2">
219+
<h2 class="anchored" data-anchor-id="new-species-vermicious-knids">New species: Vermicious Knids</h2>
220+
<p>Let’s imagine that in the forest someone has stumbled across 8 individuals of a new species called Vermicious Knids (which is a totally fictional name). If you click the button below, it will save a CSV file that you can load into a spreadsheet with information about these 8 individuals. The data has two columns: One for Male or Female, and the other for size. You can assume that the size is in centimeters.</p>
221+
<div style="text-align: center; margin: 1.5rem 0;">
222+
<p><button id="download-knids-btn">Download Vermicious Knids Data</button></p>
223+
</div>
224+
<p>Note that your data from clicking the button above will be different from other people’s data and that’s ok.</p>
225+
<section id="task-calculate-the-average-size-and-the-error-on-the-mean" class="level3">
226+
<h3 class="anchored" data-anchor-id="task-calculate-the-average-size-and-the-error-on-the-mean">Task: Calculate the average size and the error on the mean</h3>
227+
<p>There are only 8 rows in the data set. Separate the data into male and female (for example using different tabs in the spreadsheet or different parts of he spreadsheet). Then go ahead and calculate the mean, and then calculate the error on the mean by following the directions in the previous sections.</p>
228+
<p>Here are some questions to consider:</p>
229+
<ul>
230+
<li>Is there a size difference between male and female with Vermicious Knids?</li>
231+
<li>If yes, are the males larger or the females larger and by how much?</li>
232+
<li>Based on your result for the error on the mean, is it possible that the size difference can be explained by having so few individuals to measure?</li>
233+
</ul>
234+
</section>
235+
</section>
236+
<section id="two-new-species-snozzwanglers-and-hornswagglers" class="level2">
237+
<h2 class="anchored" data-anchor-id="two-new-species-snozzwanglers-and-hornswagglers">Two new species: Snozzwanglers and Hornswagglers</h2>
238+
<p>There are now three new species: Vermicious Knids, Snozzwanglers and Hornswagglers. Obviously these are all fictional names. You can click on the link below to open up a new window where you can download data about these species. The species are not related so the average size difference between male and female should be treated separately for each species.</p>
239+
<div style="text-align: center;">
240+
<p><a href="../dimorphism2.html" target="_blank">Click here to download data about all three species in a new tab</a></p>
241+
</div>
242+
<p>In the link above, you can specify how many individuals of a particular species that you would like. But <b>in real life it would be quite an effort to find 10,000 examples of a brand new species.</b> So think about how many examples you might actually need.</p>
243+
<p>Here are some questions to answer for all three species:</p>
244+
<ul>
245+
<li>Which is larger on average? Male or female?</li>
246+
<li>How much bigger or smaller are male or female individuals on average?</li>
247+
<li>What is the minimum number of individuals that you would recommend be measured in order to feel like the conclusions about the average size were not being affected by having a small number of measurements.</li>
248+
</ul>
249+
<section id="advice" class="level3">
250+
<h3 class="anchored" data-anchor-id="advice">Advice</h3>
251+
<p>There are a couple of ways to accomplish these tasks. Generally the biggest challenge will be dealing with the larger datasets and separating the male rows from the female rows.</p>
252+
<p>One way (but not the only way) to separate the male rows from the female rows would be to highlight all the data and click “Sort” and then select a Sort on Column A because Column A will be where it says M or F.</p>
253+
<script>
254+
document.getElementById('download-knids-btn').addEventListener('click', () => {
255+
function generateVermiciousKnidSize(gender) {
256+
if (gender === 'M') {
257+
return (Math.random() - 0.5) * 30 + 100;
258+
} else { // Female
259+
return (Math.random() - 0.5) * 30 + 110;
260+
}
261+
}
262+
263+
let lines = [];
264+
let allM = true;
265+
let allF = true;
266+
267+
while (allM || allF) {
268+
lines = [];
269+
allM = true;
270+
allF = true;
271+
272+
for (let i = 0; i < 8; i++) {
273+
const gender = Math.random() < 0.5 ? 'M' : 'F';
274+
if (gender === 'M') {
275+
allF = false;
276+
} else {
277+
allM = false;
278+
}
279+
280+
const size = generateVermiciousKnidSize(gender);
281+
const formattedSize = size.toFixed(0);
282+
lines.push(`${gender},${formattedSize}`);
283+
}
284+
}
285+
286+
const outputText = lines.join('\n');
287+
const blob = new Blob([outputText], { type: 'text/csv;charset=utf-8' });
288+
const url = URL.createObjectURL(blob);
289+
const a = document.createElement('a');
290+
291+
const timestamp = new Date().toISOString().slice(11, 19).replace(/:/g, '-');
292+
a.href = url;
293+
a.download = `vermicious_knids_dataset_${timestamp}.csv`;
209294

295+
document.body.appendChild(a);
296+
a.click();
210297

298+
setTimeout(() => {
299+
document.body.removeChild(a);
300+
URL.revokeObjectURL(url);
301+
}, 0);
302+
});
303+
</script>
304+
305+
306+
</section>
211307
</section>
212308
</section>
213309

‎docs/search.json‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,5 +2007,33 @@
20072007
"title": "Activity Flowcharts / Prerequisites",
20082008
"section": "STEMcoding Object Tracker",
20092009
"text": "STEMcoding Object Tracker"
2010+
},
2011+
{
2012+
"objectID": "projects/errorbar3.html#new-species-vermicious-knids",
2013+
"href": "projects/errorbar3.html#new-species-vermicious-knids",
2014+
"title": "Error bars and animal sizes",
2015+
"section": "New species: Vermicious Knids",
2016+
"text": "New species: Vermicious Knids\nLet’s imagine that in the forest someone has stumbled across 8 individuals of a new species called Vermicious Knids (which is a totally fictional name). If you click the button below, it will save a CSV file that you can load into a spreadsheet with information about these 8 individuals. The data has two columns: One for Male or Female, and the other for size. You can assume that the size is in centimeters.\n\nDownload Vermicious Knids Data\n\nNote that your data from clicking the button above will be different from other people’s data and that’s ok.\n\nTask: Calculate the average size and the error on the mean\nThere are only 8 rows in the data set. Separate the data into male and female (for example using different tabs in the spreadsheet or different parts of he spreadsheet). Then go ahead and calculate the mean, and then calculate the error on the mean by following the directions in the previous sections.\nHere are some questions to consider:\n\nIs there a size difference between male and female with Vermicious Knids?\nIf yes, are the males larger or the females larger and by how much?\nBased on your result for the error on the mean, is it possible that the size difference can be explained by having so few individuals to measure?"
2017+
},
2018+
{
2019+
"objectID": "projects/errorbar3.html#two-more-species-snozzwanglers-and-hornswagglers",
2020+
"href": "projects/errorbar3.html#two-more-species-snozzwanglers-and-hornswagglers",
2021+
"title": "Error bars and animal sizes",
2022+
"section": "Two more species: Snozzwanglers and Hornswagglers",
2023+
"text": "Two more species: Snozzwanglers and Hornswagglers"
2024+
},
2025+
{
2026+
"objectID": "projects/errorbar3.html#two-more-new-species-snozzwanglers-and-hornswagglers",
2027+
"href": "projects/errorbar3.html#two-more-new-species-snozzwanglers-and-hornswagglers",
2028+
"title": "Error bars and animal sizes",
2029+
"section": "Two more new species: Snozzwanglers and Hornswagglers",
2030+
"text": "Two more new species: Snozzwanglers and Hornswagglers"
2031+
},
2032+
{
2033+
"objectID": "projects/errorbar3.html#two-new-species-snozzwanglers-and-hornswagglers",
2034+
"href": "projects/errorbar3.html#two-new-species-snozzwanglers-and-hornswagglers",
2035+
"title": "Error bars and animal sizes",
2036+
"section": "Two new species: Snozzwanglers and Hornswagglers",
2037+
"text": "Two new species: Snozzwanglers and Hornswagglers\nThere are now three new species: Vermicious Knids, Snozzwanglers and Hornswagglers. Obviously these are all fictional names. You can click on the link below to open up a new window where you can download data about these species. The species are not related so the average size difference between male and female should be treated separately for each species.\n\nClick here to download data about all three species in a new tab\n\nIn the link above, you can specify how many individuals of a particular species that you would like. But in real life it would be quite an effort to find 10,000 examples of a brand new species. So think about how many examples you might actually need.\nHere are some questions to answer for all three species:\n\nWhich is larger on average? Male or female?\nHow much bigger or smaller are male or female individuals on average?\nWhat is the minimum number of individuals that you would recommend be measured in order to feel like the conclusions about the average size were not being affected by having a small number of measurements.\n\n\nAdvice\nThere are a couple of ways to accomplish these tasks. Generally the biggest challenge will be dealing with the larger datasets and separating the male rows from the female rows.\nOne way (but not the only way) to separate the male rows from the female rows would be to highlight all the data and click “Sort” and then select a Sort on Column A because Column A will be where it says M or F."
20102038
}
20112039
]

‎projects/errorbar3.qmd‎

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,100 @@ If you have multiple specimens that are either all male or all female then you c
3737
* Take the result from dividing by the number of measurements and take the square root
3838

3939
<b>Done!</b> You have calculated the error on the mean! If you just did this calculation for the male specimens, now do the calculation for the female specimens!
40+
41+
## New species: Vermicious Knids
42+
43+
Let's imagine that in the forest someone has stumbled across 8 individuals of a new species called Vermicious Knids (which is a totally fictional name). If you click the button below, it will save a CSV file that you can load into a spreadsheet with information about these 8 individuals. The data has two columns: One for Male or Female, and the other for size. You can assume that the size is in centimeters.
44+
45+
<div style="text-align: center; margin: 1.5rem 0;">
46+
<button id="download-knids-btn">Download Vermicious Knids Data</button>
47+
</div>
48+
49+
Note that your data from clicking the button above will be different from other people's data and that's ok.
50+
51+
### Task: Calculate the average size and the error on the mean
52+
53+
There are only 8 rows in the data set. Separate the data into male and female (for example using different tabs in the spreadsheet or different parts of he spreadsheet). Then go ahead and calculate the mean, and then calculate the error on the mean by following the directions in the previous sections.
54+
55+
Here are some questions to consider:
56+
57+
* Is there a size difference between male and female with Vermicious Knids?
58+
* If yes, are the males larger or the females larger and by how much?
59+
* Based on your result for the error on the mean, is it possible that the size difference can be explained by having so few individuals to measure?
60+
61+
## Two new species: Snozzwanglers and Hornswagglers
62+
63+
There are now three new species: Vermicious Knids, Snozzwanglers and Hornswagglers. Obviously these are all fictional names. You can click on the link below to open up a new window where you can download data about these species. The species are not related so the average size difference between male and female should be treated separately for each species.
64+
65+
<div style="text-align: center;">
66+
<a href="../dimorphism2.html" target="_blank">Click here to download data about all three species in a new tab</a>
67+
</div>
68+
69+
In the link above, you can specify how many individuals of a particular species that you would like. But <b>in real life it would be quite an effort to find 10,000 examples of a brand new species.</b> So think about how many examples you might actually need.
70+
71+
Here are some questions to answer for all three species:
72+
73+
* Which is larger on average? Male or female?
74+
* How much bigger or smaller are male or female individuals on average?
75+
* What is the minimum number of individuals that you would recommend be measured in order to feel like the conclusions about the average size were not being affected by having a small number of measurements.
76+
77+
### Advice
78+
79+
There are a couple of ways to accomplish these tasks. Generally the biggest challenge will be dealing with the larger datasets and separating the male rows from the female rows.
80+
81+
One way (but not the only way) to separate the male rows from the female rows would be to highlight all the data and click "Sort" and then select a Sort on Column A because Column A will be where it says M or F.
82+
83+
84+
85+
86+
<script>
87+
document.getElementById('download-knids-btn').addEventListener('click', () => {
88+
function generateVermiciousKnidSize(gender) {
89+
if (gender === 'M') {
90+
return (Math.random() - 0.5) * 30 + 100;
91+
} else { // Female
92+
return (Math.random() - 0.5) * 30 + 110;
93+
}
94+
}
95+
96+
let lines = [];
97+
let allM = true;
98+
let allF = true;
99+
100+
while (allM || allF) {
101+
lines = [];
102+
allM = true;
103+
allF = true;
104+
105+
for (let i = 0; i < 8; i++) {
106+
const gender = Math.random() < 0.5 ? 'M' : 'F';
107+
if (gender === 'M') {
108+
allF = false;
109+
} else {
110+
allM = false;
111+
}
112+
113+
const size = generateVermiciousKnidSize(gender);
114+
const formattedSize = size.toFixed(0);
115+
lines.push(`${gender},${formattedSize}`);
116+
}
117+
}
118+
119+
const outputText = lines.join('\n');
120+
const blob = new Blob([outputText], { type: 'text/csv;charset=utf-8' });
121+
const url = URL.createObjectURL(blob);
122+
const a = document.createElement('a');
123+
124+
const timestamp = new Date().toISOString().slice(11, 19).replace(/:/g, '-');
125+
a.href = url;
126+
a.download = `vermicious_knids_dataset_${timestamp}.csv`;
127+
128+
document.body.appendChild(a);
129+
a.click();
130+
131+
setTimeout(() => {
132+
document.body.removeChild(a);
133+
URL.revokeObjectURL(url);
134+
}, 0);
135+
});
136+
</script>

0 commit comments

Comments
 (0)