<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need help converting IML in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/702794#M33965</link>
    <description>&lt;P&gt;The obstacle is here:&lt;BR /&gt;rho_var = partialderiv*Sigma*t(partialderiv);&lt;/P&gt;
&lt;P&gt;It is quadratic form .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data partialderiv ;
set Covparms end=last;
retain a b d g h i;
if _n_=1 then a=Estimate;
if _n_=2 then b=Estimate;
if _n_=3 then c=Estimate;
if _n_=4 then g=Estimate;
if _n_=5 then h=Estimate;
if _n_=6 then i=Estimate;

if last then do;
rhohat = (b+h)/sqrt((a+g)*(c+i));
df_da = -0.5*((b+h)*(c+i))/sqrt(((a+g)*(c+i))**3);
df_db = 1/sqrt((a+g)*(c+i));
df_dc = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);
df_dg = -0.5*(b+h)*(c+i)/sqrt(((a+g)*(c+i))**3);
df_dh = 1/sqrt((a+g)*(c+i));
df_di = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);

output;
end;
keep rhohat df_da df_db df_dc df_dg df_dh df_di; /*&amp;lt;--*/
run;
/***********************/
/***********************/
data _null_;
set partialderiv;
temp=catx(' ',df_da, df_db, df_dc, df_dg, df_dh, df_di);
call symputx('value',temp);
stop;
run;

data cov;
 set Asycov;
 array x{6} _temporary_ (&amp;amp;value);
 array c{*} CovP1-CovP6;
 i+1;
 do j=1 to dim(c);
  c{j}=c{j}*x{i}*x{j};
 end;
 drop i j;
run;

proc sql;
select sum(sum(CovP1, CovP2, CovP3 ,CovP4 ,CovP5, CovP6)) into : rho_var
 from cov;
quit;

data want;
set partialderiv;
rho_SE = sqrt(&amp;amp;rho_var);
l95=rhohat-1.96*rho_SE;
u95=rhohat+1.96*rho_SE;
p = (1-cdf("normal",abs(rhohat),0,rho_SE))*2;

label
rhohat='Estimate';
rho_SE='Std Error';
l95='95% CI Lower Bound';
u95='95% CI UpperBound';
p='Pvalue' ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Dec 2020 12:44:46 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-12-01T12:44:46Z</dc:date>
    <item>
      <title>Compute standard errors without using PROC IML</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/698459#M33702</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I need to use a macro which requires use of IML - which I don't have. Is there another way to program this to get the result?&lt;/P&gt;
&lt;P&gt;For reference, the full macro is here:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2424-2018.pdf" target="_blank" rel="noopener"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2424-2018.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*Fit Hamlett (2004) mixed model*/&lt;BR /&gt;proc mixed data=&amp;amp;data._long method=ml covtest asycov asycorr;&lt;BR /&gt;class &amp;amp;ID. vtype &amp;amp;rep.;&lt;BR /&gt;model response = vtype / solution ddfm=kr;&lt;BR /&gt;random vtype / type=un subject=&amp;amp;ID. v vcorr;&lt;BR /&gt;repeated vtype / type=un subject=&amp;amp;rep.(&amp;amp;ID.);&lt;BR /&gt;ods output VCorr=VCorr ConvergenceStatus=CS asycorr=asycorr&lt;BR /&gt;asycov=asycov CovParms=CovParms;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/*Use delta method to find SE(rho), calculate CI/p-value based on normality*/&lt;BR /&gt;proc iml;&lt;BR /&gt;use Covparms;&lt;BR /&gt;read all var {Estimate} into Cov_estimate;&lt;BR /&gt;close Covparms;&lt;BR /&gt;use Asycov;&lt;BR /&gt;read all var {CovP1 CovP2 CovP3 CovP4 CovP5 CovP6} into asycov;&lt;BR /&gt;close Asycov;&lt;BR /&gt;a = Cov_estimate[1];&lt;BR /&gt;b = Cov_estimate[2];&lt;BR /&gt;c = Cov_estimate[3];&lt;BR /&gt;g = Cov_estimate[4];&lt;BR /&gt;h = Cov_estimate[5];&lt;BR /&gt;i = Cov_estimate[6];&lt;BR /&gt;rhohat = (b+h)/sqrt((a+g)*(c+i));&lt;BR /&gt;df_da = -0.5*((b+h)*(c+i))/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_db = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_dc = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dg = -0.5*(b+h)*(c+i)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dh = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_di = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;create partialderiv var {df_da df_db df_dc df_dg df_dh df_di};&lt;BR /&gt;append;&lt;BR /&gt;close partialderiv;&lt;BR /&gt;use partialderiv;&lt;BR /&gt;read all var {df_da df_db df_dc df_dg df_dh df_di} into partialderiv;&lt;BR /&gt;close partialderiv;&lt;BR /&gt;Sigma = asycov;&lt;BR /&gt;rho_var = partialderiv*Sigma*t(partialderiv);&lt;BR /&gt;rho_SE = sqrt(rho_var);&lt;BR /&gt;l95=rhohat-1.96*rho_SE;&lt;BR /&gt;u95=rhohat+1.96*rho_SE;&lt;BR /&gt;p = (1-cdf("normal",abs(rhohat),0,rho_SE))*2;&lt;BR /&gt;NormalApproxOutput = j(1,5,.);&lt;BR /&gt;NormalApproxOutput[,1]=rhohat;&lt;BR /&gt;NormalApproxOutput[,2]=rho_SE;&lt;BR /&gt;NormalApproxOutput[,3]=l95;&lt;BR /&gt;NormalApproxOutput[,4]=u95;&lt;BR /&gt;NormalApproxOutput[,5]=p;&lt;BR /&gt;Outtitle={'Estimate' 'Std Error' '95% CI Lower Bound' '95% CI Upper&lt;BR /&gt;Bound' 'Pvalue'};&lt;BR /&gt;Varnames=t("&amp;amp;var1. and &amp;amp;var2.");&lt;BR /&gt;PRINT NormalApproxOutput[colname=Outtitle rowname=Varnames];&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 14:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/698459#M33702</guid>
      <dc:creator>tka726</dc:creator>
      <dc:date>2020-11-13T14:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML Help!</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/698632#M33703</link>
      <description>&lt;P&gt;IML questions for IML Forum ,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; is there .&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 12:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/698632#M33703</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-11-13T12:14:36Z</dc:date>
    </item>
    <item>
      <title>Need help converting IML</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/698872#M33715</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I need to use a macro which requires use of IML - which I don't have. Is there another way to program this to get the result?&lt;/P&gt;&lt;P&gt;For reference, the full macro is here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2424-2018.pdf" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2424-2018.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Fit Hamlett (2004) mixed model*/&lt;BR /&gt;proc mixed data=&amp;amp;data._long method=ml covtest asycov asycorr;&lt;BR /&gt;class &amp;amp;ID. vtype &amp;amp;rep.;&lt;BR /&gt;model response = vtype / solution ddfm=kr;&lt;BR /&gt;random vtype / type=un subject=&amp;amp;ID. v vcorr;&lt;BR /&gt;repeated vtype / type=un subject=&amp;amp;rep.(&amp;amp;ID.);&lt;BR /&gt;ods output VCorr=VCorr ConvergenceStatus=CS asycorr=asycorr&lt;BR /&gt;asycov=asycov CovParms=CovParms;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*Use delta method to find SE(rho), calculate CI/p-value based on normality*/&lt;BR /&gt;proc iml;&lt;BR /&gt;use Covparms;&lt;BR /&gt;read all var {Estimate} into Cov_estimate;&lt;BR /&gt;close Covparms;&lt;BR /&gt;use Asycov;&lt;BR /&gt;read all var {CovP1 CovP2 CovP3 CovP4 CovP5 CovP6} into asycov;&lt;BR /&gt;close Asycov;&lt;BR /&gt;a = Cov_estimate[1];&lt;BR /&gt;b = Cov_estimate[2];&lt;BR /&gt;c = Cov_estimate[3];&lt;BR /&gt;g = Cov_estimate[4];&lt;BR /&gt;h = Cov_estimate[5];&lt;BR /&gt;i = Cov_estimate[6];&lt;BR /&gt;rhohat = (b+h)/sqrt((a+g)*(c+i));&lt;BR /&gt;df_da = -0.5*((b+h)*(c+i))/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_db = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_dc = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dg = -0.5*(b+h)*(c+i)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dh = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_di = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;create partialderiv var {df_da df_db df_dc df_dg df_dh df_di};&lt;BR /&gt;append;&lt;BR /&gt;close partialderiv;&lt;BR /&gt;use partialderiv;&lt;BR /&gt;read all var {df_da df_db df_dc df_dg df_dh df_di} into partialderiv;&lt;BR /&gt;close partialderiv;&lt;BR /&gt;Sigma = asycov;&lt;BR /&gt;rho_var = partialderiv*Sigma*t(partialderiv);&lt;BR /&gt;rho_SE = sqrt(rho_var);&lt;BR /&gt;l95=rhohat-1.96*rho_SE;&lt;BR /&gt;u95=rhohat+1.96*rho_SE;&lt;BR /&gt;p = (1-cdf("normal",abs(rhohat),0,rho_SE))*2;&lt;BR /&gt;NormalApproxOutput = j(1,5,.);&lt;BR /&gt;NormalApproxOutput[,1]=rhohat;&lt;BR /&gt;NormalApproxOutput[,2]=rho_SE;&lt;BR /&gt;NormalApproxOutput[,3]=l95;&lt;BR /&gt;NormalApproxOutput[,4]=u95;&lt;BR /&gt;NormalApproxOutput[,5]=p;&lt;BR /&gt;Outtitle={'Estimate' 'Std Error' '95% CI Lower Bound' '95% CI Upper&lt;BR /&gt;Bound' 'Pvalue'};&lt;BR /&gt;Varnames=t("&amp;amp;var1. and &amp;amp;var2.");&lt;BR /&gt;PRINT NormalApproxOutput[colname=Outtitle rowname=Varnames];&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Nov 2020 13:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/698872#M33715</guid>
      <dc:creator>tka726</dc:creator>
      <dc:date>2020-11-14T13:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need help converting IML</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/698947#M33716</link>
      <description>The IML is similar with data step.&lt;BR /&gt;The following code could translate into date step like:&lt;BR /&gt;proc iml;&lt;BR /&gt;use Covparms;&lt;BR /&gt;read all var {Estimate} into Cov_estimate;&lt;BR /&gt;close Covparms;&lt;BR /&gt;use Asycov;&lt;BR /&gt;read all var {CovP1 CovP2 CovP3 CovP4 CovP5 CovP6} into asycov;&lt;BR /&gt;close Asycov;&lt;BR /&gt;a = Cov_estimate[1];&lt;BR /&gt;b = Cov_estimate[2];&lt;BR /&gt;c = Cov_estimate[3];&lt;BR /&gt;g = Cov_estimate[4];&lt;BR /&gt;h = Cov_estimate[5];&lt;BR /&gt;i = Cov_estimate[6];&lt;BR /&gt;rhohat = (b+h)/sqrt((a+g)*(c+i));&lt;BR /&gt;df_da = -0.5*((b+h)*(c+i))/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_db = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_dc = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dg = -0.5*(b+h)*(c+i)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dh = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_di = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;&lt;BR /&gt;----------&amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data partialderiv  ;&lt;BR /&gt; set Covparms end=last;&lt;BR /&gt; retain a b d g h i;&lt;BR /&gt; if _n_=1 then a=Estimate;&lt;BR /&gt;  if _n_=2 then b=Estimate;&lt;BR /&gt;   if _n_=3 then c=Estimate;&lt;BR /&gt;    if _n_=4 then g=Estimate;&lt;BR /&gt;	 if _n_=5 then h=Estimate;&lt;BR /&gt;	  if _n_=6 then i=Estimate;&lt;BR /&gt;	  &lt;BR /&gt;if last then do;&lt;BR /&gt;rhohat = (b+h)/sqrt((a+g)*(c+i));&lt;BR /&gt;df_da = -0.5*((b+h)*(c+i))/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_db = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_dc = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dg = -0.5*(b+h)*(c+i)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dh = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_di = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;keep df_da df_db df_dc df_dg df_dh df_di;&lt;BR /&gt;run;</description>
      <pubDate>Sun, 15 Nov 2020 11:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/698947#M33716</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-11-15T11:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help converting IML</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/702531#M33936</link>
      <description>&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;Any idea how to code this part? I can not figure it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc iml;&lt;BR /&gt;use Covparms;&lt;BR /&gt;read all var {Estimate} into Cov_estimate;&lt;BR /&gt;close Covparms;&lt;BR /&gt;use Asycov;&lt;BR /&gt;read all var {CovP1 CovP2 CovP3 CovP4 CovP5 CovP6} into asycov;&lt;BR /&gt;close Asycov;&lt;BR /&gt;a = Cov_estimate[1];&lt;BR /&gt;b = Cov_estimate[2];&lt;BR /&gt;c = Cov_estimate[3];&lt;BR /&gt;g = Cov_estimate[4];&lt;BR /&gt;h = Cov_estimate[5];&lt;BR /&gt;i = Cov_estimate[6];&lt;BR /&gt;rhohat = (b+h)/sqrt((a+g)*(c+i));&lt;BR /&gt;df_da = -0.5*((b+h)*(c+i))/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_db = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_dc = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dg = -0.5*(b+h)*(c+i)/sqrt(((a+g)*(c+i))**3);&lt;BR /&gt;df_dh = 1/sqrt((a+g)*(c+i));&lt;BR /&gt;df_di = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;create partialderiv var {df_da df_db df_dc df_dg df_dh df_di};&lt;BR /&gt;append;&lt;BR /&gt;close partialderiv;&lt;BR /&gt;use partialderiv;&lt;BR /&gt;read all var {df_da df_db df_dc df_dg df_dh df_di} into partialderiv;&lt;BR /&gt;close partialderiv;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Sigma = asycov;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;rho_var = partialderiv*Sigma*t(partialderiv);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;rho_SE = sqrt(rho_var);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;l95=rhohat-1.96*rho_SE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;u95=rhohat+1.96*rho_SE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;p = (1-cdf("normal",abs(rhohat),0,rho_SE))*2;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;NormalApproxOutput = j(1,5,.);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;NormalApproxOutput[,1]=rhohat;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;NormalApproxOutput[,2]=rho_SE;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;NormalApproxOutput[,3]=l95;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;NormalApproxOutput[,4]=u95;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;NormalApproxOutput[,5]=p;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Outtitle={'Estimate' 'Std Error' '95% CI Lower Bound' '95% CI Upper&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Bound' 'Pvalue'};&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Varnames=t("&amp;amp;pltct. and &amp;amp;tegma.");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;PRINT NormalApproxOutput[colname=Outtitle rowname=Varnames];&lt;/FONT&gt;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 15:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/702531#M33936</guid>
      <dc:creator>tka726</dc:creator>
      <dc:date>2020-11-30T15:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help converting IML</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/702794#M33965</link>
      <description>&lt;P&gt;The obstacle is here:&lt;BR /&gt;rho_var = partialderiv*Sigma*t(partialderiv);&lt;/P&gt;
&lt;P&gt;It is quadratic form .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data partialderiv ;
set Covparms end=last;
retain a b d g h i;
if _n_=1 then a=Estimate;
if _n_=2 then b=Estimate;
if _n_=3 then c=Estimate;
if _n_=4 then g=Estimate;
if _n_=5 then h=Estimate;
if _n_=6 then i=Estimate;

if last then do;
rhohat = (b+h)/sqrt((a+g)*(c+i));
df_da = -0.5*((b+h)*(c+i))/sqrt(((a+g)*(c+i))**3);
df_db = 1/sqrt((a+g)*(c+i));
df_dc = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);
df_dg = -0.5*(b+h)*(c+i)/sqrt(((a+g)*(c+i))**3);
df_dh = 1/sqrt((a+g)*(c+i));
df_di = -0.5*(b+h)*(a+g)/sqrt(((a+g)*(c+i))**3);

output;
end;
keep rhohat df_da df_db df_dc df_dg df_dh df_di; /*&amp;lt;--*/
run;
/***********************/
/***********************/
data _null_;
set partialderiv;
temp=catx(' ',df_da, df_db, df_dc, df_dg, df_dh, df_di);
call symputx('value',temp);
stop;
run;

data cov;
 set Asycov;
 array x{6} _temporary_ (&amp;amp;value);
 array c{*} CovP1-CovP6;
 i+1;
 do j=1 to dim(c);
  c{j}=c{j}*x{i}*x{j};
 end;
 drop i j;
run;

proc sql;
select sum(sum(CovP1, CovP2, CovP3 ,CovP4 ,CovP5, CovP6)) into : rho_var
 from cov;
quit;

data want;
set partialderiv;
rho_SE = sqrt(&amp;amp;rho_var);
l95=rhohat-1.96*rho_SE;
u95=rhohat+1.96*rho_SE;
p = (1-cdf("normal",abs(rhohat),0,rho_SE))*2;

label
rhohat='Estimate';
rho_SE='Std Error';
l95='95% CI Lower Bound';
u95='95% CI UpperBound';
p='Pvalue' ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Dec 2020 12:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Compute-standard-errors-without-using-PROC-IML/m-p/702794#M33965</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-12-01T12:44:46Z</dc:date>
    </item>
  </channel>
</rss>

