Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hours=[28 23 29 21 24 28 30 19 8 11 4 15 13 20];
- grades=[5 4.5 5 5 4 4.5 5 3.5 3 3 3 3 3.5 3.5];
- [R,P] = corrcoef(hours, grades)
- t_s=0.8755*sqrt((14-2)/(1-0.8755^2))
- % H0 = p=0 HA = p=/=0
- if(t_s> 1.761)
- msgbox('We reject the null hypothesis and accept the alternative one – there is dependence between the grades and hours spent')
- end
- scatter(hours,grades,'filled')
- ylim([2 6])
- title('Correlation betwen grades and time spend on lecture')
- xlabel('Hours spent')
- ylabel('Grades')
RAW Paste Data