习题程序:1.data SCORE;input name$ sex$ Chinese maths physics chemist English; sum= Chinese+maths+physics+chemist+English ;mean=sum/5;cards;王辉男80 85 82 78 90李唱女85 93 88 70 89张三男77 86 67 82 85王二女81 78 93 83 87;run;data jinrong;Set SCORE;Where maths>85;Run;2.input x r;do i=1 to 3;x+x*r;end;cards;500 0.07;run;3.(1)data income;input year x1-x3;income=x1+x2+x3;drop x1 x2 x3;cards;1985 298.28 29.47 39.951990 510.86 70.68 75.811995 996.51 287.24 195.742000 1125.34 488.89 515.352001 1165.17 532.61 533.80;run;(2)data income(keep=year income);input year x1-x3;income=x1+x2+x3;cards;1985 298.28 29.47 39.951990 510.86 70.68 75.811995 996.51 287.24 195.742000 1125.34 488.89 515.352001 1165.17 532.61 533.80;run;(3)data income(drop=i);input x1-x3;array consum{3} x1-x3;do i=1 to 3;sum+consum(i);end;cards;1985 298.28 29.47 39.951990 510.86 70.68 75.811995 996.51 287.24 195.742000 1125.34 488.89 515.352001 1165.17 532.61 533.80;run;4.data group1 group2;input region$ income@@;if income>=2366.40 then do;output group1;n+1;end;else do;output group2;m+1;end;cards;beijing 5025.5 tianjin 3947.72 hebei 2603.6 shanxi 1956.05 nemenggu 1973.37 liaoning 2557.93 jilin 2182.22 heilong 2280.28 shanghai 5870.87 jiangsu 3784.71 zhejiang 4582.34 anhui 2020.04 fujian 3380.72 jiangxi 2231.6 shandong 2804.51 henan 2097.86 hubei 2352.16 hunanÏ 2299.46 guangdong 3769.79 guangxi 1944.33 hainan 2226.47 chongqing 1971.18 sichuan 1986.99 guizhou 1411.73 yunnan 1533.74 xizang 1404.01 shananxi 1490.8 gansu 1508.61 qinghai 1557.32 ningxia 1823.05 xinjiang 1710.44;proc print data=group1(drop=m);title 'group1';proc print data=group2(drop=n);title 'group2';run;5.data a;input region$ wage@@;if wage<10000 then delete;cards;beijing 19776 tianjin 15110 hebei 9139 shanxi 8618 neimenggu 8737liaoning 10609 jilin 9043 heilongjiang 8924 shanghai 21961jiangsu 12917zhejiang 19514 anhui 8501 fujian 13313 jiangxi 8346 shandong 11067henan 8573 hubei 9133 hunan 9991 guangdong 16779 guangxi 9209 hainan 8102 chongqing 10035 sichuan 10783 guizhou 9308 yunnan 10880 xizang 20112 shananxi 9440 gansu 10442 qinghai 14028 ningxia 11112 xinjiang 10145;run;6.data nongye;input xiangmu$ year85 year90 year95 year00 year01;cards;gulei 2 1 1 1 1roulei 2 1 1 1 1mianhua 1 1 1 1 1dadou 3 3 3 4 4;data gongye;input xiangmu$ year85 year90 year95 year99 year00;cards;gang 4 4 2 1 1mei 2 1 1 1 1yuanyou 6 5 5 5 5;data order;set nongye gongye;proc print;run;7.data gdp;input gdp1-gdp45 @@;cards;144 150 165 168 200 216 218 185 173 181 208 240 254 235 222 243 275 288 292 309 310 327 316 339 379 417 460 489 525 580 692 853 956 1104 1355 1512 1634 1879 2287 2939 3923 4854 5576 6053 6392;proc means data=gdp mean std cv skewness kurtosis;run;8.data gdp;input area$ gdp consumpt capital export@@;cards;beijing 2845.65 1467.71 1775.3 -397.36tianjin 1840.1 901.85 934.48 3.77hebei 5577.78 2509.3 2511.57 556.91shanxi 1787.76 1046.43 800.27 -58.94neimenggu 1545.326789 936.1894062 614.1373826 -5 liaoning 5033.08 2828.09 1625.5 579.49jilin 2087.87 1331.32 790.99 -34.44heilongjiang 3515.69982 2110.54 1130.53982 274.62shanghai 4950.84 2149.07 2294.46 507.31jiangsu 9403.3 4295.96 4239.17 868.17zhejiang 6749.18 3306.1 2891.02 552.06anhui 3290.130414 2108.09475 1185.495664 -3.46fujian 4218.31 2225.23 1939.61 53.47jiangxi 2161.75 1357.47 800.83 3.45shangdong 9438.31 4582.61 4513.32 342.38henan 5640.11 3114.13 2329.32 196.66hubei 4557.02 2408.84 1963.46 184.72hunan 3983 2553.14 1426.47 3.39gongdong 10647.71 5841.32 3860.81 945.58guangxi 2231.19 1597.05 769.04 -134.9hainan 546.62 299.86 254.79 -8.03chongqing 1769.77 1078.06 819.08 -127.37sichuan 4421.76 2691.47 1726.33 3.96guizhou 1084.9 833.87 599.95 -348.92yunnan 2074.71 1430.44 929.73 -285.46xizang 138.31 82.79 49.72 5.8shananxi 1844.27 1004.5 972.51 -132.74gansu 1081.51 674.42 444.89 -37.8qinghai 294.83 197.79 207.39 -110.35ningxia 298.38 223.52 207.69 -132.83xinjiang 1485.48 854.6 771.42 -140.54;proc sort;by gdp;proc transpose out = trans;id area;var gdp consumpt capital export;proc means sum;var gdp consumpt capital export;proc means mean max min std cv skewness kurtosis clm;run;9.d ata a;input r@@;cards;718525.4 723715.3 702236.6 37390.56 632662.2 443082.7 59706.7 17774.8 115653 558135.4 1581666 513099.3 213847.4 2917080 30368.26 1049252 32864.3 31972.76 364228.6 40924.85 30557.34 39874.46 32741.52 248281.1 98826.12 1956514 43551.33 387256.1 67158.48 238265.7 50744.47 51291.24 54995.52 157951.5 40349.33 220848.3 18309.99 20264.13 31359.99 41325.33 49634.95 51689.58 129214.6 35857.56 27680.21 58609.62 24192.69 15665.46 60003.2 53617.02 8605.78 85371.95 161167.1 24852.03 48598.58 36004.81 131046 68424.84 63149.74;proc means mean max min maxdec=2 var std cv skewness kurtosis alpha=0.1 clm n nmiss range;run;10.data a(drop=i);do i=1 to 100 by 1;x=normal(0);y=100+sqrt(30)*x;output;end;proc means alpha=0.05 clm;run;proc univariate data=a normal;run;11.data a;input b@@;cards;167.939 169.369 176.228 172.077 163.284 169.564 174.022 157.814 170.794 164.796 172.887 166.425 166.189 176.456 162.080 167.290 175.004 165.762 158.315 167.812 178.715 170.624 173.090 180.698 172.621 176.095 164.211 174.641 173.427 171.869 166.742 167.137 175.704 168.537 175.321 173.532 168.285 171.333 173.911 171.226 174.694 169.868 178.338 171.044 178.550 173.199 168.664 169.562 168.996;proc univariate plot;run;12.data a;input year r1 r2 r3 r4 r5 r6 r7@@;cards;1926 11.6 0.28 7.37 7.77 5.38 3.27 -1.49 1927 37.49 22.1 7.44 8.93 4.52 3.12 -2.08 1928 43.61 39.69 2.84 0.1 0.92 3.56 -0.97 1929 -8.42 -51.36 3.27 3.42 6.01 4.75 0.2 1930 -24.9 -38.15 7.98 4.66 6.72 2.41 -6.03 1931 -43.34 -49.75 -1.85 -5.31 -2.32 1.07 -9.52 1932 -8.19 -5.39 10.82 16.84 8.81 0.96 -10.3 1933 53.99 142.87 10.38 -0.07 1.83 0.3 0.51 1934 -1.44 24.22 13.84 10.03 9 0.16 2.03 1935 47.67 40.19 9.61 4.98 7.01 0.17 2.99 1936 33.92 64.8 6.74 7.52 3.06 0.18 1.21 1937 -35.03 -58.01 2.75 0.23 1.56 0.31 3.10 1938 31.12 32.8 6.13 5.53 6.23 -0.02 -2.78 1939 -0.41 0.35 3.97 5.94 4.52 0.02 -0.48 1940 -9.78 -5.16 3.39 6.09 2.96 0 0.96 1941 -11.59 -9 2.73 0.93 0.5 0.06 9.72 1942 20.3 44.51 2.6 3.22 1.94 0.27 9.29 1943 25.9 88.37 2.83 2.08 2.81 0.35 3.16 1944 19.75 53.72 4.73 2.81 1.8 0.33 2.111946 -8.07 -11.63 1.72 -0.1 1 0.35 18.16 1947 5.71 0.92 -2.34 -2.62 0.91 0.5 9.01 1948 5.5 -2.11 4.14 3.4 1.85 0.81 2.71 1949 18.79 19.75 3.31 6.45 2.32 1.10 -1.80 1950 31.71 38.75 2.12 0.06 0.7 1.2 5.79 1951 24.02 7.8 -2.69 -3.93 0.36 1.49 5.87 1952 18.37 3.03 3.52 1.16 1.63 1.66 0.88 1953 -0.99 -6.49 3.41 3.64 3.23 1.82 0.62 1954 52.62 60.58 5.39 7.19 2.68 0.86 -0.5 1955 31.56 20.44 0.48 -1.29 -0.65 1.57 0.37 1956 6.56 4.28 -6.81 -5.59 -0.42 2.46 2.86 1957 -10.78 -14.57 8.71 7.46 7.84 3.14 3.02 1958 43.36 64.89 -2.22 -6.09 -1.29 1.54 1.76 1959 11.96 16.4 -0.97 -2.26 -0.39 2.95 1.5 1960 0.47 -3.29 9.07 13.78 11.76 2.66 1.48 1961 26.89 32.09 4.82 0.97 1.85 2.13 0.67 1962 -8.73 -11.9 7.95 6.89 5.56 2.73 1.22 1963 22.8 23.57 2.19 1.21 1.64 3.12 1.65 1964 16.48 23.52 4.77 3.51 4.04 3.54 1.19 1965 12.45 41.75 -0.46 0.71 1.02 3.93 1.92 1966 -10.06 -7.01 0.2 3.65 4.69 4.76 3.35 1967 23.98 83.57 -4.95 -9.18 1.01 4.21 3.04 1968 11.06 35.97 2.57 -0.26 4.54 5.21 4.72 1969 -8.5 -25.05 -8.09 -5.07 -0.74 6.58 6.11 1970 4.01 -17.43 18.37 12.11 16.86 6.52 5.49 1971 14.31 16.5 11.01 13.23 8.72 4.39 3.36 1972 18.98 4.43 7.26 5.69 5.16 3.84 3.41 1973 -14.66 -30.9 1.14 -1.11 4.61 6.93 8.8 1974 -26.47 -19.95 -3.06 4.35 5.69 8 12.20 1975 37.2 52.82 14.64 9.2 7.83 5.8 7.01 1976 23.84 57.38 18.65 16.75 12.87 5.08 4.81 1977 -7.18 25.38 1.71 -0.69 1.41 5.12 6.77 1978 6.56 23.46 -0.07 -1.18 3.49 7.18 9.03 1979 18.44 43.46 -4.18 -1.23 4.09 10.38 13.31 1980 32.42 39.88 -2.76 -3.95 3.91 11.24 12.4 1981 -4.91 13.88 -1.24 1.86 9.45 14.71 8.94 1982 21.41 28.01 42.56 40.36 29.1 10.54 3.87 1983 22.51 39.67 6.26 0.65 7.41 8.8 3.8 1984 6.27 -6.67 16.86 15.48 14.02 9.85 3.95 1985 32.16 24.66 30.09 30.97 20.33 7.72 3.77 1986 18.47 6.85 19.85 24.53 15.14 6.16 1.13 1987 5.23 -9.3 -0.27 -2.71 2.9 5.47 4.41 1988 16.81 22.87 10.7 9.67 6.1 6.35 4.421990 -3.17 -21.56 6.78 6.18 9.73 7.81 6.11 1991 30.55 44.63 19.89 19.3 15.46 5.6 3.06 1992 7.67 23.35 9.39 8.05 7.19 3.51 2.9 1993 9.99 20.98 13.19 18.24 11.24 2.9 4.75 1994 1.31 3.11 -5.76 -7.77 -5.14 3.9 2.67 1995 37.43 34.46 27.2 31.67 16.8 5.6 2.54 1996 23.07 17.62 1.4 -0.83 2.1 5.21 3.32 1997 33.36 22.78 12.95 15.85 8.38 5.26 1.7 ;proc univariate normal;run;13.data gdp;input area$ gdp consumpt capital export@@;cards;beijing 2845.65 1467.71 1775.3 -397.36tianjin 1840.1 901.85 934.48 3.77hebei 5577.78 2509.3 2511.57 556.91shanxi 1787.76 1046.43 800.27 -58.94neimenggu 1545.326789 936.1894062 614.1373826 -5 liaoning 5033.08 2828.09 1625.5 579.49jilin 2087.87 1331.32 790.99 -34.44 heilongjiang 3515.69982 2110.54 1130.53982 274.62 shanghai 4950.84 2149.07 2294.46 507.31jiangsu 9403.3 4295.96 4239.17 868.17zhejiang 6749.18 3306.1 2891.02 552.06anhui 3290.130414 2108.09475 1185.495664 -3.46 fujian 4218.31 2225.23 1939.61 53.47jiangxi 2161.75 1357.47 800.83 3.45shangdong 9438.31 4582.61 4513.32 342.38henan 5640.11 3114.13 2329.32 196.66hubei 4557.02 2408.84 1963.46 184.72hunan 3983 2553.14 1426.47 3.39gongdong 10647.71 5841.32 3860.81 945.58guangxi 2231.19 1597.05 769.04 -134.9hainan 546.62 299.86 254.79 -8.03chongqing 1769.77 1078.06 819.08 -127.37sichuan 4421.76 2691.47 1726.33 3.96guizhou 1084.9 833.87 599.95 -348.92yunnan 2074.71 1430.44 929.73 -285.46xizang 138.31 82.79 49.72 5.8shananxi 1844.27 1004.5 972.51 -132.74gansu 1081.51 674.42 444.89 -37.8qinghai 294.83 197.79 207.39 -110.35ningxia 298.38 223.52 207.69 -132.83 xinjiang 1485.48 854.6 771.42 -140.54;proc means data=gdp mean var std cv skewness kurtosis alpha=0.1 t prt clm;var consumpt ;run;14.data a;input name$ sex$ region$ sales type$;select;when(sales<20000) group=10000;when(20000<=sales<40000) group=30000;when(40000<=sales<60000) group=50000;when(60000<=sales<80000) group=70000;otherwise group=90000;end;cards;Rose F East 9664 PPeter M West 22969 PStafer F West 27253 CStride F West 86432 CTopin M North 99210 PSpark F North 38928 CVetter M South 21531 PCurci M East 79345 PMarco M East 18523 PGreco F South 32914 CRyan F South 42109 PTomas M West 94329 CThalman F East 25718 CFarlow M North 64700 CSmith M South 27634 P;proc tabulate;class name sex type region;var sales group;table type,sex,region sales group; table region*sex;run;proc gchart;pie region/sumvar=sales;run;15.data density;input zhou$ country$ area renkou@@;density=renkou/area;if density>=100 then grade='a';else if density<10 then grade='c';else grade='b';cards;Asia China 960 126743Asia Japan 37.8 12687Asia India 297.4 100596Asia Philippines 30 7558Asia Mongolia 156.7 240Africa Eygpt 100.2 6398Africa Nigeria 92.4 12691Europe Germany 35.7 8215Europe UK 24.2 5974Europe France 55.2 5889Europe Italy 30.1 5769Europe Russian 1707.5 14556Northamerica US 937.3 28155NorthAmerica Canada 997.1 3075NorthAmerica Mexico 196.7 9797SouthAmerica Brazil 854.7 17041SouthAmerica Argentina 277.7 3703Oceania Australia 768.2 1918Oceania Newzealand 27.1 383;proc tabulate;title 'the table of population density';class zhou grade;var density;table zhou grade all, density*(n max min);run;16.data a;input date total@@;cards;90.1 1421 90.2 1367 90.3 1720 90.4 1760 90.5 1796 90.6 1848 90.7 1637 90.8 1671 90.9 1760 90.10 1790 90.11 1889 90.12 1981 91.1 1758 91.2 1486 91.3 1894 91.4 1970 91.5 2034 91.6 2103 91.7 1856 91.8 1915 91.9 2022 91.10 2045 91.11 2069 91.12 2136 91.1 1984 92.2 1812 92.3 2274 92.4 2329 92.5 2373 92.6 2516 92.7 2288 92.8 2312 92.9 2441 92.10 2502 92.11 2608 92.12 2823 93.1 2179 93.2 2409 93.3 2869 93.4 2917 93.5 3022 93.6 3274 3.7 2863 93.8 2864 93.9 2908 93.10 2912 93.11 3101 93.12 3664 94.1 2903 94.2 2513 94.3 3409 94.4 3500 94.5 3643 94.6 3871 94.7 3373 94.8 3463 94.9 3664 94.10 3753 94.11 3973 94.12 4469 95.1 2997 95.2 2740 95.12 3581 95.4 3746 95.5 3818 95.6 4041 95.7 3484 95.8 3511 95.9 3703 95.10 3811 95.11 4091 95.12 4651 96.1 3477 96.2 2970 96.3 3943 96.4 4068 96.5 4747 96.6 4417 96.7 3807 96.8 3746 96.9 4011 96.10 4130 96.11 4373 96.12 4992 97.1 3844 97.2 3182 97.3 4405 97.4 4520 97.5 4639 97.6 4970 97.7 4147 97.8 4199 97.9 4537 97.10 4719 97.11 5035 97.12 5546;run;proc sort;by total;proc gplot;plot total*date/vaxis=1000 to 6000 by 500;symbol v=plus i=spline c=blue;run;17.data shoping;input expend income number age hire@@;label expend='年食品支出:(千元) ' income=' 年收入'number=' 家庭人口数' age=' 收入最高者年龄'hire=' 房屋是否购买';cards;4.7 24 3 32 15.2 29 3 28 16.1 30 2 25 0 4.8 23 1 43 1 10.1 52 4 50 0 9.2 61 2 55 0 6.5 33 3 32 0 5.4 28 2 28 17.8 41 1 37 0 9.8 53 6 54 0 4.9 42 3 30 1 7.3 44 4 31 0 5.2 26 1 28 1 3.2 12 5 48 0 3.4 18 3 42 0 7.2 47 1 32 1 15.6 112 6 60 0 13.7 85 5 47 0 5.1 27 2 33 0 2.9 13 2 29 1 3.8 19 1 26 1 7.2 38 1 45 1 4.9 25 4 43 1 10.2 62 3 30 0 10 54 4 55 0 4.8 28 3 33 1 4.7 29 2 29 1 5.3 34 1 26 04.4 30 1 25 1 10.3 57 6 48 0 7.6 45 4 55 0 7.3 47 3 31 15.1 36 1 32 1 3.3 19 4 29 1 4.6 28 4 29 0 2.8 14 2 43 1 3.0 20 5 33 1 8.0 49 3 35 0 13.8 87 3 63 0 12.4 72 2 34 0 2.5 12 1 23 1 4.3 28 2 27 1 3.1 14 1 25 1 3.1 19 1 28 1 7.7 39 4 30 0 4.2 27 2 51 0 10.1 64 5 45 1 9.6 53 5 47 0 4.7 27 3 28 0 5.5 28 3 29 16.1 33 4 32 0 5.4 29 1 25 14.8 24 1 27 1 9.8 55 7 46 0 6.9 43 5 48 0 8.0 45 4 52 05.8 34 3 36 1 2.9 17 1 29 1 5.1 26 2 32 0 3.2 15 1 24 14.1 21 1 28 1 7.5 50 2 42 0 13.1 78 3 58 05.5 27 1 68 05.1 31 2 33 1 12.5 73 2 43 0 4.5 29 3 38 1 3.2 20 1 31 1 7.5 38 4 35 0 9.7 51 5 51 0 5.3 33 3 29 1 10.2 53 4 52 0 4.8 43 3 30 1 7.1 49 1 33 1 8.5 40 2 35 1 9.1 46 3 40 0 8.7 43 4 37 0 10.3 51 3 43 16.4 34 2 32 0 5.2 38 3 37 0 ;proc gplot ;plot age*income/vaxis=0 to 16 by 2;symbol v=star;run;proc tabulate;class hire;var income expend;table hire,income expend;table hire*(n pctn<hire>);run;18.data state;input first second third;cards;2763.9 4492.7 2945.63204.3 5251.6 3506.63831.0 6587.2 4510.14228.0 7278.0 5403.25017.0 7717.4 5813.55288.6 9102.2 7227.05800.0 11699.5 9138.66882.1 16428.5 11323.89457.2 22372.2 14930.011993.0 28537.9 17947.213844.2 33612.9 20427.514211.2 37222.7 23028.714552.4 38619.3 25173.514457.2 40417.9 27035.8;proc means t prt clm;var first second third;run;19.data a;input polit1 econ1 law1 cult1 polit2 econ2 law2 cult2@@;dpolit=polit1-polit2;decon=econ1-econ2;dlaw=law1-law2; dcult=cult1-cult2;cards;65 35 25 60 55 55 40 6575 50 20 55 50 60 45 7060 45 35 65 45 45 35 7575 40 40 70 50 50 50 7070 30 30 50 55 50 30 7555 40 35 65 60 40 45 6060 45 30 60 65 55 45 7555 40 25 60 50 60 35 8055 50 30 70 40 45 30 6550 55 35 75 45 50 45 70;proc means t prt clm;var dpolit decon dlaw dcult;run;20.data newhappy;input B C D E F G H I J K cards;39 1 1 1 3 3 5 1 3 143 1 3 3 1 3 1 1 3 138 1 3 1 3 1 1 5 1 132 1 3 3 3 3 3 5 1 141 3 1 1 1 3 5 5 1 130 1 1 1 3 1 1 1 1 139 3 3 3 3 3 3 3 3 3 33 1 3 3 3 3 5 3 3 3 15 1 3 5 3 3 5 5 1 5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 1 3 5 542 3 1 3 1 3 1 1 1 343 1 1 3 3 3 1 1 1 3 18 1 3 3 3 3 3 3 3 3 44 1 3 1 3 3 3 3 3 1 42 3 3 1 3 1 1 1 1 3 48 3 1 1 1 1 3 1 1 1 44 1 1 1 1 1 3 1 1 1 24 3 1 3 1 1 1 1 1 139 3 3 3 1 1 1 3 3 140 1 3 3 3 3 1 3 3 3 25 1 3 5 3 3 5 5 1 3 24 3 3 3 1 3 3 3 3 1 31 1 3 3 3 3 1 1 3 1 29 3 3 1 3 3 3 5 5 1 38 1 1 1 1 3 1 3 3 1 41 1 1 1 1 1 3 5 3 1 32 3 1 3 1 1 3 1 1 1 28 1 3 1 3 3 3 5 3 1 42 3 3 1 1 1 5 1 1 1 45 3 3 3 1 1 1 1 3 1 38 1 3 3 1 1 3 3 1 147 1 1 1 1 3 3 1 3 1 16 3 1 1 1 1 1 5 5 1 48 1 1 1 1 1 1 1 1 1 40 1 3 3 3 3 5 3 3 3 30 1 3 3 3 3 5 1 3 3 40 1 1 1 1 3 1 1 3 1 38 1 3 1 3 3 3 3 3 3 10 1 5 3 5 1 5 3 1 7 26 5 1 1 1 3 3 5 5 1 45 1 3 1 1 3 1 1 1 1 ;proc corr spearman kendall;var B;with C D E F G H I J K;run;21.data engle;input area$ engle@@;cards;n 67.7 c 57.5n 61.8 c 56.9n 57.8 c 53.31n 58.8 c 54.24n 57.6 c 53.82n 57.6 c 52.86n 58.1 c 50.13n 58.9 c 49.89n 58.6 c 49.92n 56.3 c 48.6n 55.1 c 46.4n 53.4 c 44.5n 52.6 c 41.9n 49.1 c 39.2n 47.7 c 37.9;proc sort; by area;proc univariate normal;var engle;by area;proc ttest ; class area;var engle;run;22.data zichfz;input type$ sold@@;cards;g 98.39 z 97.94 g 97.6 z 99.01 g 98.59 z 98.07 g 98.44 z 94.5 g 98.41 z 100.88 g 98.38 z 96.7 g 97.25 z 96.52 g 98.58 z 92.41 g 99.23 z 99.16 g 98.54 z 97.66 g 98.88 z 97.01 g 99.16 z 98.97 g 98.55 z 96.79 g 98.27 z 98.03 g 98.97 z 97.36 g 98.45 z 96.43 g 97.87 z 98g 99.2 z 98.67 g 100 z 97.28 g 98.27 z 96.34 g 97.19 z 91.59 g 99.29 z 96.64 g 98.99 z 97.13 g 97.46 z 98.56 g 98.99 z 96.88 g 89.98 z 150g 98.03 z 96.99 g 97.8 z 99.86 g 93.18 z 95.92 g 98.14 z 91.12 g 100.01 z 94.25 ;proc sort; by type;run;proc univariate normal;var sold;by type;run;proc npar1way wilcoxon; class type;var sold;run;23.data west;input goods00 goods01@@;dif=goods01-goods00;cards;13.47 15.36128.88 130.450.5 0.5393.31 95.29111.28 113.578.43 79.63114.57 118.396.55 9.2924 25.943.17 43.1236.71 38.1814.46 16.2450.41 53.912.81 28.92;proc univariate normal;var goods00 goods01 dif; run;24.data profit;input income salecost manacost tax profit;cards;5660515 4912868 427811 17545 287060 1725333 1542880 96734 4611 76711 1452182 1254814 82696 5705 98800 956443 802351 51391 5371 36649 440964 318268 20941 1571 21893 1953394 1658137 108810 16637 153004 867502 780569 42384 2244 31877 1025303 870530 59582 4497 75436 7262690 6259320 570936 20983 330910 4603819 3971448 268991 13730 276187 2976451 2600835 155475 8701 156487 856125 729628 47443 2556 64003 1272714 1130089 78857 5580 49723 448680 390230 22144 1728 30030 4370183 3887907 181083 9943 239310 1710652 1557867 79861 6046 56301 1685283 1455903 74866 8863 116854 1032003 857019 56693 4462 96957 5174417 4447083 394244 15381 274865 662746 566211 39927 2568 42198 130742 101912 6999 218 10078 723438 630002 46940 2508 37455 1564629 1380889 97369 4068 64524 330985 287932 20668 1336 20005 691074 592652 49185 2425 3432950305 43980 3201 323 2669 692077 594424 31157 2126 62258 387899 338440 29242 1211 17105 86227 73939 5286 242 4616 130934 110672 8413 548 11182 771256 674105 45221 2332 47192 ;proc corr spearman Pearson;var profit;with income salecost manacost tax;run;“属性数据分析与FREQ过程”后面的习题第一题:data a;input sex$ colour$ number@@;cards;m red 30 m blue 10 m green 10f red 20 f blue 10 f green 10;run;proc freq;weight number;tables sex*colour/chisq expected;run;第二题:data a;input sex$ regist$ n@@;cards;m y 3738 m n 4704f y 1494 f n 2827;proc freq;tables sex*regist/chisq;weight n;run;第三题:data a;input type$ sex$ y x@@;x1=y*x/100;x2=y-x1;cards;a m 825 62 a f 108 82b m 560 63 b f 25 68c m 325 37 c f 593 34d m 417 33 d f 375 35e m 191 28 ef 393 24g m 373 6 g f 341 7;proc freq;weight x2;tables type*sex/chisq;run;proc freq;weight x1;tables type*sex/chisq;run;第四题:data market;input ying$ pin$ yong$ wen$ number@@;cards4;软 N 用过高温 19 软 N 用过低温 57软 N 未用过高温 29 软 N 未用过低温 63软 M 用过高温 29 软 M 用过低温 49软 M 未用过高温 27 软 M 未用过低温 53中 N 用过高温 23 中 N 用过低温 47中 N 未用过高温 33 中 N 未用过低温 66中M 用过高温 47 中M 用过低温 55中M 未用过高温 23 中M 未用过低温 50硬 N 用过高温 24 硬 N 用过低温 37硬 N 未用过高温 42 硬 N 未用过低温 68硬M 用过高温 43 硬M 用过低温 52硬M 未用过高温 30 硬M 未用过低温 42;;;;proc freq;tables ying*pin yong*wen/nocol norow;weight number;run;第五题:data cancer;input health$ cigerat$ number@@;cards;cancer smoker 60cancer nsmoker 3ncancer smoker 32ncancer nsmoker 11;proc freq;tables health*cigerat/expected chisq norow nocol nopercent exact; weight number;run;第六题:data score;input score$ class sex$ number@@;cards;c 1 m 3 b 1 m 11 a 1 m 3 c 1 f 2b 1 f 14 a 1 f 2c 2 m 4 b 2 m 10a 2 m 7 c 2 f 3b 2 f 9 a 2 f 5;proc freq;tables class*score class*sex/chisq nocol norow nopercent;tables sex*score*class/ chisq expected norow nocol; tables class*score/chisq measures norow nocol nopercent; weight number;run;。