<?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: Diff-in-Diff using Proc ttest (or anything)? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634703#M30396</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279507"&gt;@braam&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to&amp;nbsp;&lt;A href="https://support.sas.com/kb/61/830.html" target="_self"&gt;Usage Note 61830: Estimating the difference in differences of means&lt;/A&gt;&amp;nbsp;you can use PROC GENMOD:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=temp;
class origin(ref='Europe') type(ref='SUV');
model mpg_city = origin type origin*type;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result (excerpt) with point estimate, standard error, confidence interval and significance test of the requested difference in differences:&lt;/P&gt;
&lt;PRE&gt;                               Analysis Of Maximum Likelihood Parameter Estimates

                                                    Standard     Wald 95% Confidence          Wald
Parameter                         DF    Estimate       Error           Limits           Chi-Square    Pr &amp;gt; ChiSq

Origin*Type    Asia      Sedan     1      0.5076      1.6221     -2.6716      3.6868          0.10        0.7543&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2020 11:44:03 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2020-03-25T11:44:03Z</dc:date>
    <item>
      <title>Diff-in-Diff using Proc ttest (or anything)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634673#M30395</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I would like to implement a univariate diff-in-diff test presumably using proc ttest. Any procedure would be fine with me as long as I can do so.&lt;/P&gt;
&lt;P&gt;The below dataset includes four groups by two class variables: TYPE (SUV and Sedan) and ORIGIN (Asia and Europe).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me put it this way arithmetically:&lt;/P&gt;
&lt;P&gt;Mean of mpg for Asia and Sedan: a&lt;/P&gt;
&lt;P&gt;Mean of mpg for Asia and SUV: b&lt;/P&gt;
&lt;P&gt;Mean of mpg for Europe and Sedan: c&lt;/P&gt;
&lt;P&gt;Mean of mpg for Europe and SUV: d&lt;/P&gt;
&lt;P&gt;The t-stat I want for is (a-b) - (c-d).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This way, I can see whether the mean difference in mpg between SUV and Sedan is different between Asia and Europe (i.e., diff-in-diff).&lt;/P&gt;
&lt;P&gt;Ideally, I would like to implement this using the dataset generated in the below SAS code (i.e., the one with three variables, mpg_city, origin, type).&amp;nbsp;Hope that somebody can help me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
	set sashelp.cars;
	keep mpg_city origin type; 
	where origin in ("Asia", "Europe") and Type in ("Sedan" "SUV");
	run;

proc sort data= temp;
	by origin type mpg_city; run;

proc print data= temp; run; *172;
proc tabulate data= temp;
	class origin type;
	var mpg_city;
	table origin, type*mpg_city*( n mean)  ; run;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634673#M30395</guid>
      <dc:creator>braam</dc:creator>
      <dc:date>2020-03-25T10:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Diff-in-Diff using Proc ttest (or anything)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634703#M30396</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279507"&gt;@braam&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to&amp;nbsp;&lt;A href="https://support.sas.com/kb/61/830.html" target="_self"&gt;Usage Note 61830: Estimating the difference in differences of means&lt;/A&gt;&amp;nbsp;you can use PROC GENMOD:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=temp;
class origin(ref='Europe') type(ref='SUV');
model mpg_city = origin type origin*type;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result (excerpt) with point estimate, standard error, confidence interval and significance test of the requested difference in differences:&lt;/P&gt;
&lt;PRE&gt;                               Analysis Of Maximum Likelihood Parameter Estimates

                                                    Standard     Wald 95% Confidence          Wald
Parameter                         DF    Estimate       Error           Limits           Chi-Square    Pr &amp;gt; ChiSq

Origin*Type    Asia      Sedan     1      0.5076      1.6221     -2.6716      3.6868          0.10        0.7543&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 11:44:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634703#M30396</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-25T11:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Diff-in-Diff using Proc ttest (or anything)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634712#M30397</link>
      <description>Thanks! it looks like running a regression without control variables. &lt;BR /&gt;Let me have a look at it and give it a try. Just one question. Would this method be applied to both continuous/dummy variables?</description>
      <pubDate>Wed, 25 Mar 2020 12:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634712#M30397</guid>
      <dc:creator>braam</dc:creator>
      <dc:date>2020-03-25T12:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Diff-in-Diff using Proc ttest (or anything)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634742#M30398</link>
      <description>&lt;P&gt;I think in principle this method could also be applied to continuous independent variables (or one continuous and one discrete variable), but the interpretation would be different: You would consider the change in the dependent variable per unit increase of the continuous variable rather than compare means of subgroups.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 13:06:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634742#M30398</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-25T13:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Diff-in-Diff using Proc ttest (or anything)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634878#M30399</link>
      <description>I was asking about the dependent variable, not independent variables. Sorry that I brought up some confusion.</description>
      <pubDate>Wed, 25 Mar 2020 19:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634878#M30399</guid>
      <dc:creator>braam</dc:creator>
      <dc:date>2020-03-25T19:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Diff-in-Diff using Proc ttest (or anything)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634887#M30400</link>
      <description>&lt;P&gt;Ah, I see. Yes, the method can also be applied to models with a discrete dependent variable such as logistic regression models: see section "Generalized linear models with non-identity link" in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://support.sas.com/kb/61/830.html" target="_blank" rel="nofollow noopener noreferrer"&gt;Usage Note 61830&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 20:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Diff-in-Diff-using-Proc-ttest-or-anything/m-p/634887#M30400</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-25T20:38:40Z</dc:date>
    </item>
  </channel>
</rss>

