/* x5_4.sas */ /* Purpose: */ title1 'Example 5.4.'; data a; input b1d1 b1d2 b2d1 b2d2 b3d1 b3d2 b4d1 b4d2 b5d1 b5d2; cards; 1890 2057 1925 2112 1988 1932 1967 1980 2000 2110 1863 2028 1903 2083 1876 1862 2021 2025 1769 1983 1927 1964 2043 2096 1874 1863 2014 1983 1885 2098 1830 1955 1957 2078 1914 1927 2019 1862 2004 2084 1803 1976 1946 2031 1882 1907 2002 2041 1904 2015 1951 1996 1940 2084 1774 1763 2128 2001 1865 1978 1995 2057 1916 2017 1872 1841 1949 1970 1927 2098 1967 1979 1967 2035 1822 1914 1904 2053 1972 2124 1934 2010 1958 1978 1891 1837 2029 1978 1886 2077 1897 2037 1879 2045 1855 1911 1989 1940 2019 2036 1869 2013 1995 2002 1809 1866 2052 1980 1884 2060 1847 1990 1980 2078 1894 1797 2042 1921 1990 2141 1882 2015 1934 2118 1870 1983 1835 2002 1884 2075 1965 1975 1990 2017 1910 1873 1970 1969 1938 2074 1954 1934 1906 2107 1970 1907 2028 1849 1950 2003 1973 2074 1985 2005 1980 1923 2000 2030 1999 2077 1870 2071 2000 2094 1885 1962 2041 2006 1987 2110 1894 1993 1951 1993 1775 1859 2033 1999 1823 2061 1927 1943 1979 2020 1871 1993 1996 2006 1951 2099 ; proc print data=a; title2 'List of data.'; proc means data=a; title2 'Simple statistics of data.'; data b; set a; batch=1; day=1; yards=b1d1; output; batch=1; day=2; yards=b1d2; output; batch=2; day=1; yards=b2d1; output; batch=2; day=2; yards=b2d2; output; batch=3; day=1; yards=b3d1; output; batch=3; day=2; yards=b3d2; output; batch=4; day=1; yards=b4d1; output; batch=4; day=2; yards=b4d2; output; batch=5; day=1; yards=b5d1; output; batch=5; day=2; yards=b5d2; output; keep batch day yards; proc print data=b; title2 'List of reorganised data'; proc glm; class batch day; model yards=batch day(batch) / solution; random day(batch) /test; means batch; title2 'Analysis of model with random "day". using proc glm.'; proc anova; class batch day; model yards=batch day(batch); means batch; title2 'Analysis of model with systematic "day" using proc anova.'; proc varcomp method=type1; class batch day; model yards=batch day(batch) /fixed=1; title2 'Alternative assessment of variance components.'; run;