Started statistics lecture
This commit is contained in:
16
statistics-fabian/assignments/Makefile
Normal file
16
statistics-fabian/assignments/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
all:
|
||||
for number in 001 002 003 004 005 006 007 007 009 010 011 012 013 014 015 016 017 ; do \
|
||||
echo $$number ; \
|
||||
sed "s/000/$$number/g" day1.tex > tmp.tex; \
|
||||
pdflatex tmp.tex; \
|
||||
mv tmp.pdf day1_$$number.pdf; \
|
||||
cp ../data/example$$number.csv ./ ;\
|
||||
rm tmp.* ; \
|
||||
zip example$$number.zip example$$number.csv day1_$$number.pdf ; \
|
||||
rm example$$number.csv ;\
|
||||
rm day1_$$number.pdf ; \
|
||||
done
|
||||
|
||||
clean:
|
||||
rm *.zip
|
||||
rm -rf auto
|
||||
72
statistics-fabian/assignments/day1.tex
Executable file
72
statistics-fabian/assignments/day1.tex
Executable file
@@ -0,0 +1,72 @@
|
||||
\documentclass[addpoints,10pt]{exam}
|
||||
\usepackage{url}
|
||||
\usepackage{color}
|
||||
\usepackage{hyperref}
|
||||
|
||||
\pagestyle{headandfoot}
|
||||
\runningheadrule
|
||||
\firstpageheadrule
|
||||
|
||||
\firstpageheader{Scientific Computing}{afternoon assignment day 01}{10/20/2014}
|
||||
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
|
||||
\firstpagefooter{}{}{}
|
||||
\runningfooter{}{}{}
|
||||
\pointsinmargin
|
||||
\bracketedpoints
|
||||
|
||||
%\printanswers
|
||||
\shadedsolutions
|
||||
|
||||
|
||||
\begin{document}
|
||||
%%%%%%%%%%%%%%%%%%%%% Submission instructions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\sffamily
|
||||
%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\begin{questions}
|
||||
\question To publish scientific results, you will usually need to
|
||||
use statistical methods. Some journals provide you with a brief
|
||||
description of how they expect you to apply statistical methods. One
|
||||
example can be found in the author guidelines of the journal
|
||||
Nature.
|
||||
|
||||
Assume you collected the following dataset. You can download it from
|
||||
Ilias as {\tt example000.csv}. Here is the description of the dataset:
|
||||
|
||||
\begin{quotation}
|
||||
\tt
|
||||
\input{../examples/example000.tex}
|
||||
\end{quotation}
|
||||
|
||||
\begin{parts}
|
||||
\part Download the dataset and write a script that loads it into
|
||||
matlab.
|
||||
|
||||
\part Think about the type of your data (I might ask you that
|
||||
tomorrow).
|
||||
|
||||
\part Produce a plot that displays the data in an appropriate
|
||||
way. Make sure to respect all elements of good plotting we
|
||||
discussed today.
|
||||
|
||||
\part Download the statistical checklist from nature. Produce {\bf
|
||||
one} slide that contains the plot and a concise summary of your
|
||||
data which respects the requirements made by nature (assume you
|
||||
are producing a figure legend for the figure in nature). It is
|
||||
good style to avoid expressions like ``the plot shows'' or
|
||||
similar.
|
||||
|
||||
\part Upload your code, the data, and the slide as a zip to
|
||||
Ilias. Deadline is 19h00. Structure the zip such that you can
|
||||
present you program in front of the class. Several students will
|
||||
be asked to present their slide and their code tomorrow morning.
|
||||
|
||||
\end{parts}
|
||||
|
||||
\end{questions}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\end{document}
|
||||
BIN
statistics-fabian/assignments/day1_001.pdf
Normal file
BIN
statistics-fabian/assignments/day1_001.pdf
Normal file
Binary file not shown.
BIN
statistics-fabian/assignments/day1_002.pdf
Normal file
BIN
statistics-fabian/assignments/day1_002.pdf
Normal file
Binary file not shown.
46
statistics-fabian/assignments/day2.tex
Normal file
46
statistics-fabian/assignments/day2.tex
Normal file
@@ -0,0 +1,46 @@
|
||||
\documentclass[addpoints,10pt]{exam}
|
||||
\usepackage{url}
|
||||
\usepackage{color}
|
||||
\usepackage{hyperref}
|
||||
|
||||
\pagestyle{headandfoot}
|
||||
\runningheadrule
|
||||
\firstpageheadrule
|
||||
|
||||
\firstpageheader{Scientific Computing}{afternoon assignment day 02}{10/21/2014}
|
||||
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
|
||||
\firstpagefooter{}{}{}
|
||||
\runningfooter{}{}{}
|
||||
\pointsinmargin
|
||||
\bracketedpoints
|
||||
|
||||
%\printanswers
|
||||
\shadedsolutions
|
||||
|
||||
|
||||
\begin{document}
|
||||
%%%%%%%%%%%%%%%%%%%%% Submission instructions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\sffamily
|
||||
%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\begin{questions}
|
||||
\question Download example002 from yesterday (brain weights).
|
||||
\begin{parts}
|
||||
\part Simulate a null distribution via permutation.
|
||||
\part Determine whether you can reject ``means are equal'' on a
|
||||
5\% significance level using the simulated null distribution.
|
||||
\part Check whether the means are different with a two sample
|
||||
t-test in matlab ({\tt ttest2}).
|
||||
\part Plot the data appropriately and generate a single slide that
|
||||
contains the plot and short discussion of the test that respects
|
||||
the nature statistical checklist (ignore all question whether the
|
||||
assumptions of the test are satisfied).
|
||||
\part Upload the slide and the code to Ilias. Deadline is 19h00.
|
||||
\end{parts}
|
||||
\end{questions}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\end{document}
|
||||
65
statistics-fabian/assignments/day3.tex
Normal file
65
statistics-fabian/assignments/day3.tex
Normal file
@@ -0,0 +1,65 @@
|
||||
\documentclass[addpoints,10pt]{exam}
|
||||
\usepackage{url}
|
||||
\usepackage{color}
|
||||
\usepackage{hyperref}
|
||||
|
||||
\pagestyle{headandfoot}
|
||||
\runningheadrule
|
||||
\firstpageheadrule
|
||||
|
||||
\firstpageheader{Scientific Computing}{afternoon assignment day 02}{10/22/2014}
|
||||
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
|
||||
\firstpagefooter{}{}{}
|
||||
\runningfooter{}{}{}
|
||||
\pointsinmargin
|
||||
\bracketedpoints
|
||||
|
||||
%\printanswers
|
||||
\shadedsolutions
|
||||
|
||||
|
||||
\begin{document}
|
||||
%%%%%%%%%%%%%%%%%%%%% Submission instructions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\sffamily
|
||||
%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\begin{questions}
|
||||
\question When the p-value is small, we reject the null
|
||||
hypothesis. For example, if you want to test whether two means are
|
||||
not equal, the null hypothesis is ``means are equal''. If e.g. $p\le
|
||||
0.05$ then we take it as sufficient evidence that the null
|
||||
hypothesis is not true. Therefore, we assume that the means are not
|
||||
equal (which is what you want to show).
|
||||
|
||||
In this exercise we will look at what kind of p-values we expect if
|
||||
the null hypothesis is true. In our example, this would be the case
|
||||
if the true means of two datasets are actually equal.
|
||||
\begin{parts}
|
||||
\part Think about how you expect the p-values to behave in that
|
||||
situation.
|
||||
\part Simulate the situation in which the means are equal by
|
||||
repeating the following at least $1000$ times:
|
||||
\begin{enumerate}
|
||||
\item Generate two arrays {\tt x} and {\tt y} with $10$ normally
|
||||
(Gaussian) distributed random numbers using {\tt randn}. By
|
||||
construction, the true means behind the random number are zero.
|
||||
\item Perform a two sample t-test ({\tt ttest2}) on {\tt x} and
|
||||
{\tt y}. Store the p-value.
|
||||
\end{enumerate}
|
||||
\part Plot a histogram of the $1000$ p-values. What do you think
|
||||
is the distribution the p-values (i.e. if you repeated this
|
||||
experiment many more times, how would the histogram look like)?
|
||||
\part Given what you find, think about whether the following
|
||||
strategy is statistically valid: You collect $10$ data points from
|
||||
each group and perform a test. If the test is not significant, you
|
||||
collect $10$ more and repeat the test. If the test tells you that
|
||||
there is a significant difference you stop. Otherwise you repeat
|
||||
the procedure until the test is significant.
|
||||
\end{parts}
|
||||
\end{questions}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\end{document}
|
||||
43
statistics-fabian/assignments/example001.csv
Executable file
43
statistics-fabian/assignments/example001.csv
Executable file
@@ -0,0 +1,43 @@
|
||||
MAO,Diagnosis
|
||||
6.8,I
|
||||
4.1,I
|
||||
7.3,I
|
||||
14.2,I
|
||||
18.8,I
|
||||
9.9,I
|
||||
7.4,I
|
||||
11.9,I
|
||||
5.2,I
|
||||
7.8,I
|
||||
7.8,I
|
||||
8.7,I
|
||||
12.7,I
|
||||
14.5,I
|
||||
10.7,I
|
||||
8.4,I
|
||||
9.7,I
|
||||
10.6,I
|
||||
7.8,II
|
||||
4.4,II
|
||||
11.4,II
|
||||
3.1,II
|
||||
4.3,II
|
||||
10.1,II
|
||||
1.5,II
|
||||
7.4,II
|
||||
5.2,II
|
||||
10,II
|
||||
3.7,II
|
||||
5.5,II
|
||||
8.5,II
|
||||
7.7,II
|
||||
6.8,II
|
||||
3.1,II
|
||||
6.4,III
|
||||
10.8,III
|
||||
1.1,III
|
||||
2.9,III
|
||||
4.5,III
|
||||
5.8,III
|
||||
9.4,III
|
||||
6.8,III
|
||||
|
186
statistics-fabian/assignments/example002.csv
Executable file
186
statistics-fabian/assignments/example002.csv
Executable file
@@ -0,0 +1,186 @@
|
||||
Weight,Sex
|
||||
1607,m
|
||||
1157,m
|
||||
1248,m
|
||||
1310,m
|
||||
1398,m
|
||||
1237,m
|
||||
1232,m
|
||||
1343,m
|
||||
1380,m
|
||||
1274,m
|
||||
1245,m
|
||||
1286,m
|
||||
1508,m
|
||||
1105,m
|
||||
1123,m
|
||||
1198,m
|
||||
1300,m
|
||||
1249,m
|
||||
1185,m
|
||||
915,m
|
||||
1345,m
|
||||
1107,m
|
||||
1357,m
|
||||
1227,m
|
||||
1205,m
|
||||
1435,m
|
||||
1289,m
|
||||
1093,m
|
||||
1211,m
|
||||
1260,m
|
||||
1193,m
|
||||
1330,m
|
||||
1130,m
|
||||
1357,m
|
||||
1193,m
|
||||
1232,m
|
||||
1321,m
|
||||
1260,m
|
||||
1380,m
|
||||
1230,m
|
||||
1136,m
|
||||
1029,m
|
||||
1223,m
|
||||
1240,m
|
||||
1264,m
|
||||
1020,m
|
||||
1415,m
|
||||
1410,m
|
||||
1275,m
|
||||
1230,m
|
||||
1085,m
|
||||
1048,m
|
||||
1181,m
|
||||
1103,m
|
||||
1165,m
|
||||
1547,m
|
||||
1173,m
|
||||
1660,m
|
||||
1307,m
|
||||
1535,m
|
||||
1315,m
|
||||
1257,m
|
||||
1424,m
|
||||
1309,m
|
||||
1170,m
|
||||
1412,m
|
||||
1270,m
|
||||
1230,m
|
||||
1233,m
|
||||
1561,m
|
||||
1193,m
|
||||
1272,m
|
||||
1355,m
|
||||
1137,m
|
||||
1354,m
|
||||
1110,m
|
||||
1265,m
|
||||
1407,m
|
||||
1227,m
|
||||
1330,m
|
||||
1222,m
|
||||
1305,m
|
||||
1475,m
|
||||
1177,m
|
||||
1337,m
|
||||
1145,m
|
||||
1070,m
|
||||
1305,m
|
||||
1085,m
|
||||
1303,m
|
||||
1390,m
|
||||
1532,m
|
||||
1238,m
|
||||
1233,m
|
||||
1280,m
|
||||
1245,m
|
||||
1459,m
|
||||
1157,m
|
||||
1302,m
|
||||
1385,m
|
||||
1310,m
|
||||
1342,m
|
||||
1303,m
|
||||
1248,m
|
||||
1115,m
|
||||
1365,m
|
||||
1227,m
|
||||
1353,m
|
||||
1125,f
|
||||
1027,f
|
||||
1112,f
|
||||
983,f
|
||||
1090,f
|
||||
1247,f
|
||||
1045,f
|
||||
983,f
|
||||
972,f
|
||||
1045,f
|
||||
937,f
|
||||
1245,f
|
||||
1200,f
|
||||
1270,f
|
||||
1200,f
|
||||
1145,f
|
||||
1090,f
|
||||
1040,f
|
||||
1343,f
|
||||
1010,f
|
||||
1095,f
|
||||
1180,f
|
||||
1168,f
|
||||
1095,f
|
||||
1040,f
|
||||
1235,f
|
||||
1050,f
|
||||
1038,f
|
||||
1046,f
|
||||
1255,f
|
||||
1228,f
|
||||
1000,f
|
||||
1225,f
|
||||
1220,f
|
||||
1085,f
|
||||
1067,f
|
||||
1006,f
|
||||
1138,f
|
||||
1175,f
|
||||
1252,f
|
||||
1037,f
|
||||
958,f
|
||||
1020,f
|
||||
1068,f
|
||||
1107,f
|
||||
1317,f
|
||||
952,f
|
||||
1056,f
|
||||
1203,f
|
||||
1183,f
|
||||
1392,f
|
||||
1130,f
|
||||
1284,f
|
||||
996,f
|
||||
1228,f
|
||||
1087,f
|
||||
1035,f
|
||||
1170,f
|
||||
1064,f
|
||||
1250,f
|
||||
1129,f
|
||||
1088,f
|
||||
1037,f
|
||||
1117,f
|
||||
1095,f
|
||||
1027,f
|
||||
1027,f
|
||||
1190,f
|
||||
1153,f
|
||||
1037,f
|
||||
1120,f
|
||||
1212,f
|
||||
1024,f
|
||||
1135,f
|
||||
1177,f
|
||||
1096,f
|
||||
1114,f
|
||||
|
Reference in New Issue
Block a user