1 The SAS System 11:23 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:23 2 options ls=175 ps=50 pageno=1; 3 4 ************************************************************** 5 * "Power Calculations..." -- Table 8 * 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: 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\TBL08.pgm * 20 * MAINFRAME REF: ulisala.ihdp.cntl(p0104) * 21 * * 22 * DATE: 1/20/93 PROGRAMMER: Bethel Fetterman * 23 **************************************************************; 24 25 footnote 'j:\powerpgm\tables\pgm\TBL08.pgm'; 26 27 **************************************************************; 28 title 'Power Calculations for Table 8'; 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:23 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 BETASCAL = {.5 1 2}; 1763 SIGSCAL = {.5 1 2}; 1764 1765 ***** Calculate Beta for times {18, 36} *****; 1766 ***** For an explanation, see Appendix B *****; 1767 time = {1 12 144, 1 24 576, 1 36 1296}; 1768 newtime = {1 12 144, 1 18 324, 1 36 1296}; 1769 newbeta = beta_old * inv(time`) * newtime`; 1770 BETA = newbeta[,2:3]; 1771 print BETA; 1772 1773 ***** Obtain Sigma for times {18, 36} *****; 1774 ***** NOTE: Sigma here should be the lower right 2x2 submatrix *****; 1775 ***** of Sigma from Table 2. However, this Sigma is *****; 1776 ***** slightly different because rho values used here *****; 1777 ***** were rounded to only 2 decimal places. *****; 1778 rho = {1 .64, .64 1}; 1779 var = {251.916 244.578}; 1780 d = diag(sqrt(var)); 1781 SIGMA = d*rho*d; 1782 print SIGMA; 1783 1784 **** Contrasts for Time by Predictor Interaction ****; 1785 C = j(3,1,0) || i(3); 3 The SAS System 11:23 Tuesday, January 26, 1993 1785 ** Mother's IQ trend coefficients **; 1786 U = {1 -1}`; 1787 1788 ***** Distribution of Mother's IQ *****; 1789 ***** IHDP Ratios of 21 Intervals *****; 1790 percent = { 0.6 1.8 4.7 7.1 6.5 11.8 10.0 1791 13.5 7.1 8.8 8.8 5.3 1.8 2.9 1792 1.2 4.1 0.6 1.8 0.6 0.6 0.6}`; 1793 sumpct = sum(percent); 1794 prop = percent / sumpct; 1794 ** Proportion of Mother's IQ **; 1795 ** in each of 21 categories **; 1796 1797 zscore = j(21,1,-4.25) + 0.25#(1:21)`; 1797 ** Correspond to IQ **; 1798 1799 ***** Creation of Essence(X) *****; 1800 nplanvec = {100 200 400}`; 1800 ** Desired sample size N **; 1801 do inplan=1 to nrow(nplanvec); 1802 nplan = nplanvec[inplan,1]; 1803 freq = round(nplan#prop, 1); 1803 ** Frequency dist'n of IQ **; 1804 nobs = sum(freq); 1804 ** based on N and PROP **; 1805 ziq={.}; 1806 ** Create a vector containing FREQ[i] occurrences **; 1807 ** of the score ZSCORE[i]. This is the expected **; 1808 ** vector of Z-scores. **; 1809 do iz = 1 to nrow(zscore); 1810 if freq[iz,1]>0 then 1811 ziq = ziq // j(freq[iz,1],1,zscore[iz,1]); 1812 end; 1813 ziq = ziq[2:nrow(ziq),1]; 1814 ESSENCEX = j(nobs,1,1) || ziq || ziq##2 || ziq##3; 1815 1816 ALPHA = 0.05; 1817 REPN = 1; 1818 1819 RUN POWER; 1820 outpower = outpower // _holdpow; 1821 if inplan ^= nrow(nplanvec) then print /; 1822 end; 1823 1824 create outdata var _holdnm; 1825 append from outpower; 1826 close outdata; NOTE: The data set WORK.OUTDATA has 27 observations and 9 variables. 4 The SAS System 11:23 Tuesday, January 26, 1993 1827 quit; Exiting IML. NOTE: The PROCEDURE IML printed pages 1-7. NOTE: The PROCEDURE IML used 42.56 seconds. 1828 1829 proc sort data=outdata; 1830 by sigscal total_n betascal; 1831 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. 1832 1833 proc print data=outdata noobs; 1834 var sigscal total_n betascal wlk_pwr gg_pwr; 1835 title 'Table 8'; 1836 format wlk_pwr gg_pwr 4.2; 1837 run; NOTE: The PROCEDURE PRINT printed page 8. NOTE: The PROCEDURE PRINT used .68 seconds. 1838 **************************************************************; NOTE: SAS Institute Inc., SAS Circle, PO Box 8000, Cary, NC 27512-8000 Power Calculations for Table 8 11:23 Tuesday, January 26, 1993 1 BETA 109.06375 98.827 6.3225 10.674 -0.776163 -1.297 -0.395325 -0.7182 SIGMA 251.916 158.86073 158.86073 244.578 j:\powerpgm\tables\pgm\TBL08.pgm Power Calculations for Table 8 11:23 Tuesday, January 26, 1993 2 BETA 109.06375 98.827 6.3225 10.674 -0.776163 -1.297 -0.395325 -0.7182 SIGMA 251.916 158.86073 158.86073 244.578 _RHO_ 1 0.64 0.64 1 C 0 1 0 0 0 0 1 0 0 0 0 1 U 1 -1 CBETAU C*BETA*U = -4.3515 0.5208375 0.322875 WARNING: One or more power values rounded to 1. For example, with ROUND=3, power=1 should be reported as power>.999 j:\powerpgm\tables\pgm\TBL08.pgm Power Calculations for Table 8 11:23 Tuesday, January 26, 1993 3 _HOLDPOW CASE ALPHA SIGSCAL BETASCAL TOTAL_N WLK_PWR EPSILON GG_EXEPS GG_PWR 1 0.05 0.5 0.5 102 0.224 1 1 0.224 2 0.05 0.5 1 102 0.741 1 1 0.741 3 0.05 0.5 2 102 1 1 1 1 4 0.05 1 0.5 102 0.13 1 1 0.13 5 0.05 1 1 102 0.424 1 1 0.424 6 0.05 1 2 102 0.969 1 1 0.969 7 0.05 2 0.5 102 0.088 1 1 0.088 8 0.05 2 1 102 0.224 1 1 0.224 9 0.05 2 2 102 0.741 1 1 0.741 j:\powerpgm\tables\pgm\TBL08.pgm Power Calculations for Table 8 11:23 Tuesday, January 26, 1993 4 BETA 109.06375 98.827 6.3225 10.674 -0.776163 -1.297 -0.395325 -0.7182 SIGMA 251.916 158.86073 158.86073 244.578 _RHO_ 1 0.64 0.64 1 C 0 1 0 0 0 0 1 0 0 0 0 1 U 1 -1 CBETAU C*BETA*U = -4.3515 0.5208375 0.322875 WARNING: One or more power values rounded to 1. For example, with ROUND=3, power=1 should be reported as power>.999 j:\powerpgm\tables\pgm\TBL08.pgm Power Calculations for Table 8 11:23 Tuesday, January 26, 1993 5 _HOLDPOW CASE ALPHA SIGSCAL BETASCAL TOTAL_N WLK_PWR EPSILON GG_EXEPS GG_PWR 1 0.05 0.5 0.5 201 0.355 1 1 0.355 2 0.05 0.5 1 201 0.931 1 1 0.931 3 0.05 0.5 2 201 1 1 1 1 4 0.05 1 0.5 201 0.19 1 1 0.19 5 0.05 1 1 201 0.648 1 1 0.648 6 0.05 1 2 201 0.999 1 1 0.999 7 0.05 2 0.5 201 0.115 1 1 0.115 8 0.05 2 1 201 0.355 1 1 0.355 9 0.05 2 2 201 0.931 1 1 0.931 j:\powerpgm\tables\pgm\TBL08.pgm Power Calculations for Table 8 11:23 Tuesday, January 26, 1993 6 BETA 109.06375 98.827 6.3225 10.674 -0.776163 -1.297 -0.395325 -0.7182 SIGMA 251.916 158.86073 158.86073 244.578 _RHO_ 1 0.64 0.64 1 C 0 1 0 0 0 0 1 0 0 0 0 1 U 1 -1 CBETAU C*BETA*U = -4.3515 0.5208375 0.322875 WARNING: One or more power values rounded to 1. For example, with ROUND=3, power=1 should be reported as power>.999 j:\powerpgm\tables\pgm\TBL08.pgm Power Calculations for Table 8 11:23 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 397 0.643 1 1 0.643 2 0.05 0.5 1 397 0.999 1 1 0.999 3 0.05 0.5 2 397 1 1 1 1 4 0.05 1 0.5 397 0.351 1 1 0.351 5 0.05 1 1 397 0.928 1 1 0.928 6 0.05 1 2 397 1 1 1 1 7 0.05 2 0.5 397 0.189 1 1 0.189 8 0.05 2 1 397 0.643 1 1 0.643 9 0.05 2 2 397 0.999 1 1 0.999 j:\powerpgm\tables\pgm\TBL08.pgm Table 8 11:23 Tuesday, January 26, 1993 8 SIGSCAL TOTAL_N BETASCAL WLK_PWR GG_PWR 0.5 102 0.5 0.22 0.22 0.5 102 1.0 0.74 0.74 0.5 102 2.0 1.00 1.00 0.5 201 0.5 0.36 0.36 0.5 201 1.0 0.93 0.93 0.5 201 2.0 1.00 1.00 0.5 397 0.5 0.64 0.64 0.5 397 1.0 1.00 1.00 0.5 397 2.0 1.00 1.00 1.0 102 0.5 0.13 0.13 1.0 102 1.0 0.42 0.42 1.0 102 2.0 0.97 0.97 1.0 201 0.5 0.19 0.19 1.0 201 1.0 0.65 0.65 1.0 201 2.0 1.00 1.00 1.0 397 0.5 0.35 0.35 1.0 397 1.0 0.93 0.93 1.0 397 2.0 1.00 1.00 2.0 102 0.5 0.09 0.09 2.0 102 1.0 0.22 0.22 2.0 102 2.0 0.74 0.74 2.0 201 0.5 0.12 0.12 2.0 201 1.0 0.36 0.36 2.0 201 2.0 0.93 0.93 2.0 397 0.5 0.19 0.19 2.0 397 1.0 0.64 0.64 2.0 397 2.0 1.00 1.00 j:\powerpgm\tables\pgm\TBL08.pgm