Commit 552d3f5a authored by conmccoid's avatar conmccoid
Browse files

StatsPharm fall 2020: exercises for retake exams

parent 5862c165
X1=[15.5,14.7,13.8,17.0,16.5,15.5,17.0,16.4,14.8];
X2=[14.6,13.0,14.5,16.9,14.1,15.6,16.9,16.6,14.8];
D=X2-X1;
mu=mean(D);
sigma=std(D);
T=mu*sqrt(9)/sigma;
disp(['mean: ', num2str(mu)])
disp(['std: ', num2str(sigma)])
disp(['test: ', num2str(T)])
y=[91;94;82;88;81;81;82]; X=[ones(7,1),(1:7)'];
alpha=(X'*X) \ (X'*y);
disp(['intercept: ',num2str(alpha(1))]);
disp(['slope: ',num2str(alpha(2))]);
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment