<?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 Unexpected increase in std error with covariate included in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Unexpected-increase-in-std-error-with-covariate-included/m-p/40323#M10434</link>
    <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I've added comments to the code below to try and explain the problem&lt;BR /&gt;
I'm having.  Basically, I have found that the average standard error&lt;BR /&gt;
increased from case 1 to case 2, yet a covariate was included in the&lt;BR /&gt;
second case.&lt;BR /&gt;
&lt;BR /&gt;
I can provide the input datafile (kind of surprised I can't attach it&lt;BR /&gt;
to this post) if one would like to run the code.  I always like being&lt;BR /&gt;
able to reproduce the problem myself.&lt;BR /&gt;
&lt;BR /&gt;
My question is this:  At worst, wouldn't the error term&lt;BR /&gt;
in case 2 (code below "title 4") be less than or equal to the error &lt;BR /&gt;
term in case 1 (code below title 1)?  I wouldn't expect a covariate&lt;BR /&gt;
to increase the error?  Average errors are provided in the commented &lt;BR /&gt;
code below.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Eric&lt;BR /&gt;
&lt;BR /&gt;
/* Some preliminary code - Read in data and some additional */&lt;BR /&gt;
/* processing                                               */&lt;BR /&gt;
&lt;BR /&gt;
data morway; infile 'c:\temp&lt;BR /&gt;
\All_Soil_Salinity_Data_For_AOV_Update_With_Covariants.txt'&lt;BR /&gt;
expandtabs;&lt;BR /&gt;
input loc $ field $ season $ year Ece logECe ECE_sd WTD ECgw SM Sand&lt;BR /&gt;
Silt Clay Theta_resid Theta_sat Ks;&lt;BR /&gt;
&lt;BR /&gt;
if season='Early' then time = 2*(year-1999)+1;&lt;BR /&gt;
if season='Late' then time = 2*(year-1999)+2;&lt;BR /&gt;
if loc ne 'loc';&lt;BR /&gt;
*if year ge 2002;&lt;BR /&gt;
proc print data=morway(obs=21);run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=morway; by loc;run;&lt;BR /&gt;
&lt;BR /&gt;
/* Original analysis with odd behavoir in standard error between */&lt;BR /&gt;
/* analyses titled 1 &amp;amp; 4 for the 'loc=DS' case.                  */&lt;BR /&gt;
/* Avg stderr in title 1, loc=DS = 0.02118134                    */&lt;BR /&gt;
/* Avg stderr in title 4, loc=DS = 0.021399158                   */&lt;BR /&gt;
&lt;BR /&gt;
 title '1) reduced sample size - no cov - remove rows with missing&lt;BR /&gt;
Sand, Silt, Clay, wtd, ECgw, &amp;amp; SM';&lt;BR /&gt;
proc mixed data=morway; class  field  year loc season;by loc;&lt;BR /&gt;
 model logece = season|year  /ddfm=kr; where not missing(Sand) and not&lt;BR /&gt;
missing(Silt) and not missing(Clay) and not missing(wtd) and not&lt;BR /&gt;
missing(ECgw) and not missing(SM) and not missing(Theta_resid) and not&lt;BR /&gt;
missing(Theta_sat) and not missing(Ks);&lt;BR /&gt;
 repeated year*season/subject=field(loc) r rcorr type=sp(pow)(time);&lt;BR /&gt;
 lsmeans season*year/ adjust=tukey;&lt;BR /&gt;
 ods output lsmeans = lsmeans;&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
 title '4) reduced sample size - with cov SM - remove rows with&lt;BR /&gt;
missing Sand, Silt, Clay, wtd, ECgw, &amp;amp; SM';&lt;BR /&gt;
proc mixed data=morway; class  field  year loc season;by loc;&lt;BR /&gt;
 model logece = season|year SM /ddfm=kr; where not missing(Sand) and&lt;BR /&gt;
not missing(Silt) and not missing(Clay) and not missing(wtd) and not&lt;BR /&gt;
missing(ECgw) and not missing(SM) and not missing(Theta_resid) and not&lt;BR /&gt;
missing(Theta_sat) and not missing(Ks);&lt;BR /&gt;
 repeated year*season/subject=field(loc) r rcorr type=sp(pow)(time);&lt;BR /&gt;
 lsmeans season*year/ adjust=tukey;&lt;BR /&gt;
 ods output lsmeans = lsmeans;&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
/* Modified analysis with odd behavoir persisting in standard */&lt;BR /&gt;
/* error between analyses titled 1 &amp;amp; 4 for the 'loc=DS' case. */&lt;BR /&gt;
/* ddfm=kr (Kenwood-Rodgers) argument removed                 */&lt;BR /&gt;
/* 'repeated' line commented out                              */&lt;BR /&gt;
/* Avg stderr in title 1, loc=DS = 0.023698976                */&lt;BR /&gt;
/* Avg stderr in title 4, loc=DS = 0.023820179                */&lt;BR /&gt;
&lt;BR /&gt;
 title '1) reduced sample size - no cov - remove rows with missing&lt;BR /&gt;
Sand, Silt, Clay, wtd, ECgw, &amp;amp; SM';&lt;BR /&gt;
proc mixed data=morway; class  field  year loc season;by loc;&lt;BR /&gt;
 model logece = season|year  /; where not missing(Sand) and not&lt;BR /&gt;
missing(Silt) and not missing(Clay) and not missing(wtd) and not&lt;BR /&gt;
missing(ECgw) and not missing(SM) and not missing(Theta_resid) and not&lt;BR /&gt;
missing(Theta_sat) and not missing(Ks);&lt;BR /&gt;
 *repeated year*season/subject=field(loc) r rcorr type=sp(pow)(time);&lt;BR /&gt;
 lsmeans season*year/ adjust=tukey;&lt;BR /&gt;
 ods output lsmeans = lsmeans;&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
 title '4) reduced sample size - with cov - SM';&lt;BR /&gt;
proc mixed data=morway; class  field  year loc season;by loc;&lt;BR /&gt;
 model logece = season|year SM /; where not missing(Sand) and not&lt;BR /&gt;
missing(Silt) and not missing(Clay) and not missing(wtd) and not&lt;BR /&gt;
missing(ECgw) and not missing(SM) and not missing(Theta_resid) and not&lt;BR /&gt;
missing(Theta_sat) and not missing(Ks);&lt;BR /&gt;
 *repeated year*season/subject=field(loc) r rcorr type=sp(pow)(time);&lt;BR /&gt;
 lsmeans season*year/ adjust=tukey;&lt;BR /&gt;
 ods output lsmeans = lsmeans;&lt;BR /&gt;
 run;</description>
    <pubDate>Sun, 28 Nov 2010 13:13:20 GMT</pubDate>
    <dc:creator>emorway</dc:creator>
    <dc:date>2010-11-28T13:13:20Z</dc:date>
    <item>
      <title>Unexpected increase in std error with covariate included</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unexpected-increase-in-std-error-with-covariate-included/m-p/40323#M10434</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I've added comments to the code below to try and explain the problem&lt;BR /&gt;
I'm having.  Basically, I have found that the average standard error&lt;BR /&gt;
increased from case 1 to case 2, yet a covariate was included in the&lt;BR /&gt;
second case.&lt;BR /&gt;
&lt;BR /&gt;
I can provide the input datafile (kind of surprised I can't attach it&lt;BR /&gt;
to this post) if one would like to run the code.  I always like being&lt;BR /&gt;
able to reproduce the problem myself.&lt;BR /&gt;
&lt;BR /&gt;
My question is this:  At worst, wouldn't the error term&lt;BR /&gt;
in case 2 (code below "title 4") be less than or equal to the error &lt;BR /&gt;
term in case 1 (code below title 1)?  I wouldn't expect a covariate&lt;BR /&gt;
to increase the error?  Average errors are provided in the commented &lt;BR /&gt;
code below.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Eric&lt;BR /&gt;
&lt;BR /&gt;
/* Some preliminary code - Read in data and some additional */&lt;BR /&gt;
/* processing                                               */&lt;BR /&gt;
&lt;BR /&gt;
data morway; infile 'c:\temp&lt;BR /&gt;
\All_Soil_Salinity_Data_For_AOV_Update_With_Covariants.txt'&lt;BR /&gt;
expandtabs;&lt;BR /&gt;
input loc $ field $ season $ year Ece logECe ECE_sd WTD ECgw SM Sand&lt;BR /&gt;
Silt Clay Theta_resid Theta_sat Ks;&lt;BR /&gt;
&lt;BR /&gt;
if season='Early' then time = 2*(year-1999)+1;&lt;BR /&gt;
if season='Late' then time = 2*(year-1999)+2;&lt;BR /&gt;
if loc ne 'loc';&lt;BR /&gt;
*if year ge 2002;&lt;BR /&gt;
proc print data=morway(obs=21);run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=morway; by loc;run;&lt;BR /&gt;
&lt;BR /&gt;
/* Original analysis with odd behavoir in standard error between */&lt;BR /&gt;
/* analyses titled 1 &amp;amp; 4 for the 'loc=DS' case.                  */&lt;BR /&gt;
/* Avg stderr in title 1, loc=DS = 0.02118134                    */&lt;BR /&gt;
/* Avg stderr in title 4, loc=DS = 0.021399158                   */&lt;BR /&gt;
&lt;BR /&gt;
 title '1) reduced sample size - no cov - remove rows with missing&lt;BR /&gt;
Sand, Silt, Clay, wtd, ECgw, &amp;amp; SM';&lt;BR /&gt;
proc mixed data=morway; class  field  year loc season;by loc;&lt;BR /&gt;
 model logece = season|year  /ddfm=kr; where not missing(Sand) and not&lt;BR /&gt;
missing(Silt) and not missing(Clay) and not missing(wtd) and not&lt;BR /&gt;
missing(ECgw) and not missing(SM) and not missing(Theta_resid) and not&lt;BR /&gt;
missing(Theta_sat) and not missing(Ks);&lt;BR /&gt;
 repeated year*season/subject=field(loc) r rcorr type=sp(pow)(time);&lt;BR /&gt;
 lsmeans season*year/ adjust=tukey;&lt;BR /&gt;
 ods output lsmeans = lsmeans;&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
 title '4) reduced sample size - with cov SM - remove rows with&lt;BR /&gt;
missing Sand, Silt, Clay, wtd, ECgw, &amp;amp; SM';&lt;BR /&gt;
proc mixed data=morway; class  field  year loc season;by loc;&lt;BR /&gt;
 model logece = season|year SM /ddfm=kr; where not missing(Sand) and&lt;BR /&gt;
not missing(Silt) and not missing(Clay) and not missing(wtd) and not&lt;BR /&gt;
missing(ECgw) and not missing(SM) and not missing(Theta_resid) and not&lt;BR /&gt;
missing(Theta_sat) and not missing(Ks);&lt;BR /&gt;
 repeated year*season/subject=field(loc) r rcorr type=sp(pow)(time);&lt;BR /&gt;
 lsmeans season*year/ adjust=tukey;&lt;BR /&gt;
 ods output lsmeans = lsmeans;&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
/* Modified analysis with odd behavoir persisting in standard */&lt;BR /&gt;
/* error between analyses titled 1 &amp;amp; 4 for the 'loc=DS' case. */&lt;BR /&gt;
/* ddfm=kr (Kenwood-Rodgers) argument removed                 */&lt;BR /&gt;
/* 'repeated' line commented out                              */&lt;BR /&gt;
/* Avg stderr in title 1, loc=DS = 0.023698976                */&lt;BR /&gt;
/* Avg stderr in title 4, loc=DS = 0.023820179                */&lt;BR /&gt;
&lt;BR /&gt;
 title '1) reduced sample size - no cov - remove rows with missing&lt;BR /&gt;
Sand, Silt, Clay, wtd, ECgw, &amp;amp; SM';&lt;BR /&gt;
proc mixed data=morway; class  field  year loc season;by loc;&lt;BR /&gt;
 model logece = season|year  /; where not missing(Sand) and not&lt;BR /&gt;
missing(Silt) and not missing(Clay) and not missing(wtd) and not&lt;BR /&gt;
missing(ECgw) and not missing(SM) and not missing(Theta_resid) and not&lt;BR /&gt;
missing(Theta_sat) and not missing(Ks);&lt;BR /&gt;
 *repeated year*season/subject=field(loc) r rcorr type=sp(pow)(time);&lt;BR /&gt;
 lsmeans season*year/ adjust=tukey;&lt;BR /&gt;
 ods output lsmeans = lsmeans;&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
 title '4) reduced sample size - with cov - SM';&lt;BR /&gt;
proc mixed data=morway; class  field  year loc season;by loc;&lt;BR /&gt;
 model logece = season|year SM /; where not missing(Sand) and not&lt;BR /&gt;
missing(Silt) and not missing(Clay) and not missing(wtd) and not&lt;BR /&gt;
missing(ECgw) and not missing(SM) and not missing(Theta_resid) and not&lt;BR /&gt;
missing(Theta_sat) and not missing(Ks);&lt;BR /&gt;
 *repeated year*season/subject=field(loc) r rcorr type=sp(pow)(time);&lt;BR /&gt;
 lsmeans season*year/ adjust=tukey;&lt;BR /&gt;
 ods output lsmeans = lsmeans;&lt;BR /&gt;
 run;</description>
      <pubDate>Sun, 28 Nov 2010 13:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unexpected-increase-in-std-error-with-covariate-included/m-p/40323#M10434</guid>
      <dc:creator>emorway</dc:creator>
      <dc:date>2010-11-28T13:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected increase in std error with covariate included</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unexpected-increase-in-std-error-with-covariate-included/m-p/40324#M10435</link>
      <description>Hi Eric.&lt;BR /&gt;
&lt;BR /&gt;
I think you need to provide us with a small sample of your data and some code. Or seriously re-write your post. Its completely not-understandable.&lt;BR /&gt;
&lt;BR /&gt;
Are you redefineing your model, or adding more restrictions with the covariates?&lt;BR /&gt;
&lt;BR /&gt;
Is the variance in covariate matrix estimated or approximated?&lt;BR /&gt;
&lt;BR /&gt;
We need more background info. If a covariate matrix is wrong, it might increase the error term as a result of more variance.&lt;BR /&gt;
&lt;BR /&gt;
1) What kind of data are you working with?&lt;BR /&gt;
2) What is your model?&lt;BR /&gt;
3) How are you changeing your model, and why do you have a reason to believe that your covariatematrix will make the std smaller?

Message was edited by: TMorville</description>
      <pubDate>Mon, 29 Nov 2010 10:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unexpected-increase-in-std-error-with-covariate-included/m-p/40324#M10435</guid>
      <dc:creator>TMorville</dc:creator>
      <dc:date>2010-11-29T10:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected increase in std error with covariate included</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unexpected-increase-in-std-error-with-covariate-included/m-p/40325#M10436</link>
      <description>With the KR df option, almost anything can happen. I like the KR method for denominator df estimation with correlated data (and unbalanced data sets), but investigators must be aware that the df results depend on the model structure and the data (estimated variance-covariances for the random effects).</description>
      <pubDate>Wed, 01 Dec 2010 21:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unexpected-increase-in-std-error-with-covariate-included/m-p/40325#M10436</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2010-12-01T21:12:59Z</dc:date>
    </item>
  </channel>
</rss>

