1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
| clear;clc load 'physical fitness test.mat'
MIN = min(Test); MAX = max(Test); MEAN = mean(Test); MEDIAN = median(Test); SKEWNESS = skewness(Test); KURTOSIS = kurtosis(Test); STD = std(Test); RESULT = [MIN;MAX;MEAN;MEDIAN;SKEWNESS;KURTOSIS;STD]
R = corrcoef(Test)
x = -4:0.1:4; y = tpdf(x,28); figure(1) plot(x,y,'-') grid on hold on
tinv(0.975,28)
plot([-2.048,-2.048],[0,tpdf(-2.048,28)],'r-') plot([2.048,2.048],[0,tpdf(2.048,28)],'r-')
x = -4:0.1:4; y = tpdf(x,28); figure(2) plot(x,y,'-') grid on hold on
plot([-3.055,-3.055],[0,tpdf(-3.055,28)],'r-') plot([3.055,3.055],[0,tpdf(3.055,28)],'r-') disp('该检验值对应的p值为:') disp((1-tcdf(3.055,28))*2)
[R,P] = corrcoef(Test)
P < 0.01 (P < 0.05) .* (P > 0.01) (P < 0.1) .* (P > 0.05)
x = normrnd(2,3,100,1); skewness(x) kurtosis(x) qqplot(x)
[h,p] = jbtest(Test(:,1),0.05) [h,p] = jbtest(Test(:,1),0.01)
n_c = size(Test,2); H = zeros(1,6); P = zeros(1,6); for i = 1:n_c [h,p] = jbtest(Test(:,i),0.05); H(i)=h; P(i)=p; end disp(H) disp(P)
qqplot(Test(:,1))
X = [3 8 4 7 2]' Y = [5 10 9 10 6]'
1-6*(1+0.25+0.25+1)/5/24
coeff = corr(X , Y , 'type' , 'Spearman')
RX = [2 5 3 4 1] RY = [1 4.5 3 4.5 2] R = corrcoef(RX,RY)
R = corr(Test, 'type' , 'Spearman')
disp(sqrt(590)*0.0301)
disp((1-normcdf(0.7311))*2)
[R,P]=corr(Test, 'type' , 'Spearman')
|