1 The SAS System 11:22 Tuesday, January 26, 1993 NOTE: Copyright(c) 1989 by SAS Institute Inc., Cary, NC USA. NOTE: SAS (r) Proprietary Software Release 6.06.03 Licensed to UNC - CHAPEL HILL, Site 0003944003. NOTE: AUTOEXEC processing beginning; file is D:\SAS\AUTOEXEC.SAS. NOTE: AUTOEXEC processing completed. 1 %put &SYSDATE &SYSTIME; 26JAN93 11:22 2 options ls=175 ps=50 pageno=1; 3 4 ************************************************************** 5 * "Power Calculations..." -- Table 7 * 6 * Muller, LaVange, Ramey & Ramey * 7 * * 8 * Approximate power for test of interaction between * 9 * Time and Mother's IQ. * 10 * Based on multivariate regression model predicting * 11 * Child IQ from Mother's IQ. * 12 * Observation with standardized IQ > 3.0 deleted. * 13 * Times: 12, 18, 36 months * 14 * Mother's IQ distribution is for high school dropouts * 15 * from IHDP follow-up groups. * 16 * IHDP ratios of 4 intervals: IHDP spread within * 17 * Beta and Sigma estimates from Table 2. * 18 * * 19 * PROGRAM: j:\powerpgm\tables\pgm\TBL07.pgm * 20 * MAINFRAME REF: ulisala.ihdp.cntl(p0103) * 21 * * 22 * DATE: 1/20/93 PROGRAMMER: Bethel Fetterman * 23 **************************************************************; 24 25 footnote 'j:\powerpgm\tables\pgm\TBL07.pgm'; 26 27 **************************************************************; 28 title 'Power Calculations for Table 7'; 29 proc iml workspace=300; Worksize = 307200 Symbol size = 65520 IML Ready 30 %include 'j:\powerlib\powerlib.iml' / nosource2; NOTE: Module _INPTCHK defined. NOTE: Module _OPTCHK defined. 2 The SAS System 11:22 Tuesday, January 26, 1993 NOTE: Module _SNGRCHK defined. NOTE: Module _SIZECHK defined. NOTE: Module _TYPECHK defined. NOTE: Module _SETOPT defined. NOTE: Module _PROBF defined. NOTE: Module _HLTMOD defined. NOTE: Module _PBTMOD defined. NOTE: Module _WLKMOD defined. NOTE: Module _SPECIAL defined. NOTE: Module _UNIMOD defined. NOTE: Module _GGEXEPS defined. NOTE: Module _HFEXEPS defined. NOTE: Module _LASTUNI defined. NOTE: Module _SASDS defined. NOTE: Module _POWER defined. NOTE: Module POWER defined. 1754 1755 opt_off = {rhoscal collapse}; 1756 1757 beta_old = {114.463 104.658 98.827 , 1758 2.882 8.768 10.674 , 1759 -.7097 -.8962 -1.297 , 1760 -.2056 -.5440 -.7182}; 1761 1762 SIGMA = {218.478 83.662 72.191, 1763 83.662 251.916 158.603, 1764 72.191 158.603 244.578}; 1765 1766 BETASCAL = {.5 1 2}; 1767 SIGSCAL = {.5 1 2}; 1768 1769 ***** Calculate Beta for times {12, 18, 36} *****; 1770 ***** For an explanation, see Appendix B *****; 1771 time = {1 12 144, 1 24 576, 1 36 1296}; 1772 newtime = {1 12 144, 1 18 324, 1 36 1296}; 1773 BETA = beta_old * inv(time`) * newtime`; 1774 print BETA; 1775 1776 **** Contrasts for Time by Predictor Interaction ****; 1777 C = j(3,1,0) || i(3); 1777 ** Mother's IQ trend coefficients **; 1778 1779 timesobs = {12 18 36}`; 1779 ** Degree of trend in child IQ over time **; 1780 polytobs = orpol(timesobs); 1781 U = polytobs[,2:3]; 1781 ** Linear & Quadratic **; 1782 3 The SAS System 11:22 Tuesday, January 26, 1993 1783 ***** Distribution of Mother's IQ *****; 1784 ***** IHDP Ratios of 21 Intervals *****; 1785 percent = { 0.6 1.8 4.7 7.1 6.5 11.8 10.0 1786 13.5 7.1 8.8 8.8 5.3 1.8 2.9 1787 1.2 4.1 0.6 1.8 0.6 0.6 0.6}`; 1788 sumpct = sum(percent); 1789 prop = percent / sumpct; 1789 ** Proportion of Mother's IQ **; 1790 ** in each of 21 categories **; 1791 1792 zscore = j(21,1,-4.25) + 0.25#(1:21)`; 1792 ** Correspond to IQ **; 1793 ** values 40-115 **; 1794 1795 ***** Creation of Essence(X) *****; 1796 nplanvec = {100 200 400}`; 1796 ** Desired sample size N **; 1797 do inplan=1 to nrow(nplanvec); 1798 nplan = nplanvec[inplan,1]; 1799 freq = round(nplan#prop, 1); 1799 ** Frequency dist'n of IQ **; 1800 nobs = sum(freq); 1800 ** based on N and PROP **; 1801 ziq={.}; 1802 ** Create a vector containing FREQ[i] occurrences **; 1803 ** of the score ZSCORE[i]. This is the expected **; 1804 ** vector of Z-scores. **; 1805 do iz = 1 to nrow(zscore); 1806 if freq[iz,1]>0 then 1807 ziq = ziq // j(freq[iz,1],1,zscore[iz,1]); 1808 end; 1809 ziq = ziq[2:nrow(ziq),1]; 1810 ESSENCEX = j(nobs,1,1) || ziq || ziq##2 || ziq##3; 1811 1812 ALPHA = 0.05; 1813 REPN = 1; 1814 1815 RUN POWER; 1816 outpower = outpower // _holdpow; 1817 if inplan ^= nrow(nplanvec) then print /; 1818 end; 1819 1820 create outdata var _holdnm; 1821 append from outpower; 1822 close outdata; NOTE: The data set WORK.OUTDATA has 27 observations and 9 variables. 1823 quit; Exiting IML. 4 The SAS System 11:22 Tuesday, January 26, 1993 NOTE: The PROCEDURE IML printed pages 1-10. NOTE: The PROCEDURE IML used 43.06 seconds. 1824 1825 proc sort data=outdata; 1826 by sigscal total_n betascal; 1827 run; NOTE: SAS sort was used. NOTE: The data set WORK.OUTDATA has 27 observations and 9 variables. NOTE: The PROCEDURE SORT used .71 seconds. 1828 1829 proc print data=outdata noobs; 1830 var sigscal total_n betascal wlk_pwr gg_pwr; 1831 title 'Table 7'; 1832 format wlk_pwr gg_pwr 4.2; 1833 run; NOTE: The PROCEDURE PRINT printed page 11. NOTE: The PROCEDURE PRINT used .58 seconds. 1834 **************************************************************; NOTE: SAS Institute Inc., SAS Circle, PO Box 8000, Cary, NC 27512-8000 Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 1 BETA 114.463 109.06375 98.827 2.882 6.3225 10.674 -0.7097 -0.776163 -1.297 -0.2056 -0.395325 -0.7182 j:\powerpgm\tables\pgm\TBL07.pgm Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 2 BETA 114.463 109.06375 98.827 2.882 6.3225 10.674 -0.7097 -0.776163 -1.297 -0.2056 -0.395325 -0.7182 SIGMA 218.478 83.662 72.191 83.662 251.916 158.603 72.191 158.603 244.578 _RHO_ 1 0.3566125 0.3122989 0.3566125 1 0.6389617 0.3122989 0.6389617 1 C 0 1 0 0 0 0 1 0 0 0 0 1 U -0.566139 0.5883484 -0.226455 -0.784465 0.7925939 0.1961161 CBETAU C*BETA*U = 5.396772 -1.170813 -0.45044 -0.063042 -0.363319 0.0483034 WARNING: One or more power values rounded to 1. For example, with ROUND=3, j:\powerpgm\tables\pgm\TBL07.pgm Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 3 power=1 should be reported as power>.999 j:\powerpgm\tables\pgm\TBL07.pgm Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 4 _HOLDPOW CASE ALPHA SIGSCAL BETASCAL TOTAL_N WLK_PWR EPSILON GG_EXEPS GG_PWR 1 0.05 0.5 0.5 102 0.295 0.902 0.892 0.289 2 0.05 0.5 1 102 0.891 0.902 0.892 0.892 3 0.05 0.5 2 102 1 0.902 0.892 1 4 0.05 1 0.5 102 0.158 0.902 0.892 0.155 5 0.05 1 1 102 0.571 0.902 0.892 0.564 6 0.05 1 2 102 0.997 0.902 0.892 0.998 7 0.05 2 0.5 102 0.099 0.902 0.892 0.097 8 0.05 2 1 102 0.295 0.902 0.892 0.289 9 0.05 2 2 102 0.891 0.902 0.892 0.892 j:\powerpgm\tables\pgm\TBL07.pgm Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 5 BETA 114.463 109.06375 98.827 2.882 6.3225 10.674 -0.7097 -0.776163 -1.297 -0.2056 -0.395325 -0.7182 SIGMA 218.478 83.662 72.191 83.662 251.916 158.603 72.191 158.603 244.578 _RHO_ 1 0.3566125 0.3122989 0.3566125 1 0.6389617 0.3122989 0.6389617 1 C 0 1 0 0 0 0 1 0 0 0 0 1 U -0.566139 0.5883484 -0.226455 -0.784465 0.7925939 0.1961161 CBETAU C*BETA*U = 5.396772 -1.170813 -0.45044 -0.063042 -0.363319 0.0483034 WARNING: One or more power values rounded to 1. For example, with ROUND=3, j:\powerpgm\tables\pgm\TBL07.pgm Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 6 power=1 should be reported as power>.999 j:\powerpgm\tables\pgm\TBL07.pgm Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 7 _HOLDPOW CASE ALPHA SIGSCAL BETASCAL TOTAL_N WLK_PWR EPSILON GG_EXEPS GG_PWR 1 0.05 0.5 0.5 201 0.481 0.902 0.897 0.466 2 0.05 0.5 1 201 0.99 0.902 0.897 0.989 3 0.05 0.5 2 201 1 0.902 0.897 1 4 0.05 1 0.5 201 0.245 0.902 0.897 0.237 5 0.05 1 1 201 0.821 0.902 0.897 0.808 6 0.05 1 2 201 1 0.902 0.897 1 7 0.05 2 0.5 201 0.136 0.902 0.897 0.133 8 0.05 2 1 201 0.481 0.902 0.897 0.466 9 0.05 2 2 201 0.99 0.902 0.897 0.989 j:\powerpgm\tables\pgm\TBL07.pgm Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 8 BETA 114.463 109.06375 98.827 2.882 6.3225 10.674 -0.7097 -0.776163 -1.297 -0.2056 -0.395325 -0.7182 SIGMA 218.478 83.662 72.191 83.662 251.916 158.603 72.191 158.603 244.578 _RHO_ 1 0.3566125 0.3122989 0.3566125 1 0.6389617 0.3122989 0.6389617 1 C 0 1 0 0 0 0 1 0 0 0 0 1 U -0.566139 0.5883484 -0.226455 -0.784465 0.7925939 0.1961161 CBETAU C*BETA*U = 5.396772 -1.170813 -0.45044 -0.063042 -0.363319 0.0483034 WARNING: One or more power values rounded to 1. For example, with ROUND=3, j:\powerpgm\tables\pgm\TBL07.pgm Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 9 power=1 should be reported as power>.999 j:\powerpgm\tables\pgm\TBL07.pgm Power Calculations for Table 7 11:22 Tuesday, January 26, 1993 10 _HOLDPOW CASE ALPHA SIGSCAL BETASCAL TOTAL_N WLK_PWR EPSILON GG_EXEPS GG_PWR 1 0.05 0.5 0.5 397 0.82 0.902 0.899 0.802 2 0.05 0.5 1 397 1 0.902 0.899 1 3 0.05 0.5 2 397 1 0.902 0.899 1 4 0.05 1 0.5 397 0.478 0.902 0.899 0.461 5 0.05 1 1 397 0.99 0.902 0.899 0.988 6 0.05 1 2 397 1 0.902 0.899 1 7 0.05 2 0.5 397 0.243 0.902 0.899 0.235 8 0.05 2 1 397 0.82 0.902 0.899 0.802 9 0.05 2 2 397 1 0.902 0.899 1 j:\powerpgm\tables\pgm\TBL07.pgm Table 7 11:22 Tuesday, January 26, 1993 11 SIGSCAL TOTAL_N BETASCAL WLK_PWR GG_PWR 0.5 102 0.5 0.30 0.29 0.5 102 1.0 0.89 0.89 0.5 102 2.0 1.00 1.00 0.5 201 0.5 0.48 0.47 0.5 201 1.0 0.99 0.99 0.5 201 2.0 1.00 1.00 0.5 397 0.5 0.82 0.80 0.5 397 1.0 1.00 1.00 0.5 397 2.0 1.00 1.00 1.0 102 0.5 0.16 0.16 1.0 102 1.0 0.57 0.56 1.0 102 2.0 1.00 1.00 1.0 201 0.5 0.25 0.24 1.0 201 1.0 0.82 0.81 1.0 201 2.0 1.00 1.00 1.0 397 0.5 0.48 0.46 1.0 397 1.0 0.99 0.99 1.0 397 2.0 1.00 1.00 2.0 102 0.5 0.10 0.10 2.0 102 1.0 0.30 0.29 2.0 102 2.0 0.89 0.89 2.0 201 0.5 0.14 0.13 2.0 201 1.0 0.48 0.47 2.0 201 2.0 0.99 0.99 2.0 397 0.5 0.24 0.24 2.0 397 1.0 0.82 0.80 2.0 397 2.0 1.00 1.00 j:\powerpgm\tables\pgm\TBL07.pgm