<?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 Adjusted Means Equivocal to STATA? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-Means-Equivocal-to-STATA/m-p/145568#M7612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;First to summarize the situation:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;I am looking to adjust, lets say the mean blood pressure (amongst numerous other variables) across groups controlling for factors such as age, race, family history.&amp;nbsp; Which based on previous studies and experience I would do something such as this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;glm&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;data&lt;/SPAN&gt;=dataset;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;class&lt;/SPAN&gt; groups;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;model&lt;/SPAN&gt; bloodpressure = groups age race familyhistory;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;lsmeans&lt;/SPAN&gt; groups;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: calibri, verdana, arial, sans-serif;"&gt;However it is more complicated than this and I'm actually looking to make more than one table.&amp;nbsp; Lets say in one table I want to calculate the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="79"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="93"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD colspan="3" style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="272"&gt;&lt;P align="center" style="text-align: center;"&gt;Cases&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="79"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="93"&gt;&lt;P&gt;Controls&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="87"&gt;&lt;P&gt;Total&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="92"&gt;&lt;P&gt;Low Physical Activity&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="92"&gt;&lt;P&gt;High Physical Activity&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="79"&gt;&lt;P&gt;Adj Mean BP&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="93"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="87"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="92"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="92"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;and in the proceeding table:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="100"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="104"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD colspan="4" style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="239"&gt;&lt;P align="center" style="text-align: center;"&gt;Cases&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="100"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="104"&gt;&lt;P&gt;Controls&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="49"&gt;&lt;P&gt;Total&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="52"&gt;&lt;P&gt;Never&lt;/P&gt;&lt;P&gt;Smoked&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="69"&gt;&lt;P&gt;Former&lt;/P&gt;&lt;P&gt;Smoker&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="69"&gt;&lt;P&gt;Current Smoker&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="100"&gt;&lt;P&gt;Adj Mean BP&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="104"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="49"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="52"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="69"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="69"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;The problem then lies in that to produce these tables (and potentially more) I run multiple models (inserting the respective grouping variable each time).&amp;nbsp; When you run the glm procedure multiple times it recenters for each run and thus I get different adj means for my controls and total cases.&amp;nbsp; Thus the hierarchal nature of these tables is not maintained in SAS and you can not collapse with consistency (Since again you running in separate models).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;I've found a way to resolve this in STATA with the following code (Which utilizes one Model), but I hate STATA and would much prefer to remain in SAS and not export my data.&amp;nbsp; Here is how it is accomplished it below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;capture program drop AdjMeans &lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;program define AdjMeans&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; syntax varname&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; xi: regress `varlist' age race fam_history i.caco_all&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; quietly {&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; * Age *&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; sum&amp;nbsp;&amp;nbsp; age&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if e(sample)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; local age1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = r(mean)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; * Race *&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; sum&amp;nbsp;&amp;nbsp; race&amp;nbsp; if e(sample)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; local race1&amp;nbsp; = r(mean)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; * Family History *&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; sum&amp;nbsp;&amp;nbsp; fam_history&amp;nbsp;&amp;nbsp;&amp;nbsp; if e(sample)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; local fam_history1&amp;nbsp;&amp;nbsp;&amp;nbsp; = r(mean)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; ** Adjusted Means for Controls, Cases **&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; adjust age =`age1' race = `race1' fam_history = `fam_history1' if e(sample), by(caco) se gen(lnmean std)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; drop lnmean std&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; ** Adjusted Means for Controls, Cases (high physical activity vs. low physical activity) **&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; adjust age =`age1' race = `race1' fam_history = `fam_history1' if e(sample), by(caco_activity) se gen(lnmean std)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; drop lnmean std&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; ** Adjusted Means for Controls, Cases (Smoking Activity) **&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; adjust age =`age1' race = `race1' fam_history = `fam_history1' if e(sample), by(caco_smk) se gen(lnmean std)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; drop lnmean std&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;end&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;AdjMeans bp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*note caco_all represents the dummy coding for all groupings i.e:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; line-height: 1.5em; color: #0433ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; caco_hi = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; and caco_neversmoker&amp;nbsp;&amp;nbsp; = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;then&lt;/SPAN&gt; caco_all = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; caco_hi = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; and caco_formersmoker&amp;nbsp; = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;then&lt;/SPAN&gt; caco_all = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; caco_hi = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; and caco_currentsmoker = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; caco_all = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; caco_lo = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; and caco_neversmoker&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; caco_all = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; caco_lo = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; and caco_formersmoker&amp;nbsp; = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;then&lt;/SPAN&gt; caco_all = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; caco_lo = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; and caco_currentsmoker = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; caco_all = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; caco&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; caco_all = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;7&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any insight into alternatives in SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Oct 2014 13:59:37 GMT</pubDate>
    <dc:creator>epistats</dc:creator>
    <dc:date>2014-10-28T13:59:37Z</dc:date>
    <item>
      <title>Adjusted Means Equivocal to STATA?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-Means-Equivocal-to-STATA/m-p/145568#M7612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;First to summarize the situation:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;I am looking to adjust, lets say the mean blood pressure (amongst numerous other variables) across groups controlling for factors such as age, race, family history.&amp;nbsp; Which based on previous studies and experience I would do something such as this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;glm&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;data&lt;/SPAN&gt;=dataset;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;class&lt;/SPAN&gt; groups;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;model&lt;/SPAN&gt; bloodpressure = groups age race familyhistory;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;lsmeans&lt;/SPAN&gt; groups;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: calibri, verdana, arial, sans-serif;"&gt;However it is more complicated than this and I'm actually looking to make more than one table.&amp;nbsp; Lets say in one table I want to calculate the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="79"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="93"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD colspan="3" style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="272"&gt;&lt;P align="center" style="text-align: center;"&gt;Cases&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="79"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="93"&gt;&lt;P&gt;Controls&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="87"&gt;&lt;P&gt;Total&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="92"&gt;&lt;P&gt;Low Physical Activity&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="92"&gt;&lt;P&gt;High Physical Activity&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="79"&gt;&lt;P&gt;Adj Mean BP&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="93"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="87"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="92"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="92"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;and in the proceeding table:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="100"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="104"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD colspan="4" style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="239"&gt;&lt;P align="center" style="text-align: center;"&gt;Cases&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="100"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="104"&gt;&lt;P&gt;Controls&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="49"&gt;&lt;P&gt;Total&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="52"&gt;&lt;P&gt;Never&lt;/P&gt;&lt;P&gt;Smoked&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="69"&gt;&lt;P&gt;Former&lt;/P&gt;&lt;P&gt;Smoker&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="69"&gt;&lt;P&gt;Current Smoker&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="100"&gt;&lt;P&gt;Adj Mean BP&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="104"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="49"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="52"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="69"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="69"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;The problem then lies in that to produce these tables (and potentially more) I run multiple models (inserting the respective grouping variable each time).&amp;nbsp; When you run the glm procedure multiple times it recenters for each run and thus I get different adj means for my controls and total cases.&amp;nbsp; Thus the hierarchal nature of these tables is not maintained in SAS and you can not collapse with consistency (Since again you running in separate models).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;I've found a way to resolve this in STATA with the following code (Which utilizes one Model), but I hate STATA and would much prefer to remain in SAS and not export my data.&amp;nbsp; Here is how it is accomplished it below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;capture program drop AdjMeans &lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;program define AdjMeans&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; syntax varname&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; xi: regress `varlist' age race fam_history i.caco_all&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; quietly {&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; * Age *&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; sum&amp;nbsp;&amp;nbsp; age&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if e(sample)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; local age1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = r(mean)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; * Race *&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; sum&amp;nbsp;&amp;nbsp; race&amp;nbsp; if e(sample)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; local race1&amp;nbsp; = r(mean)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; * Family History *&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; sum&amp;nbsp;&amp;nbsp; fam_history&amp;nbsp;&amp;nbsp;&amp;nbsp; if e(sample)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp;&amp;nbsp; local fam_history1&amp;nbsp;&amp;nbsp;&amp;nbsp; = r(mean)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; ** Adjusted Means for Controls, Cases **&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; adjust age =`age1' race = `race1' fam_history = `fam_history1' if e(sample), by(caco) se gen(lnmean std)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; drop lnmean std&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; ** Adjusted Means for Controls, Cases (high physical activity vs. low physical activity) **&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; adjust age =`age1' race = `race1' fam_history = `fam_history1' if e(sample), by(caco_activity) se gen(lnmean std)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; drop lnmean std&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; ** Adjusted Means for Controls, Cases (Smoking Activity) **&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; adjust age =`age1' race = `race1' fam_history = `fam_history1' if e(sample), by(caco_smk) se gen(lnmean std)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&amp;nbsp; drop lnmean std&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;end&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;AdjMeans bp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*note caco_all represents the dummy coding for all groupings i.e:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; line-height: 1.5em; color: #0433ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; caco_hi = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; and caco_neversmoker&amp;nbsp;&amp;nbsp; = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;then&lt;/SPAN&gt; caco_all = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; caco_hi = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; and caco_formersmoker&amp;nbsp; = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;then&lt;/SPAN&gt; caco_all = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; caco_hi = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; and caco_currentsmoker = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; caco_all = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; caco_lo = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; and caco_neversmoker&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; caco_all = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; caco_lo = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; and caco_formersmoker&amp;nbsp; = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;then&lt;/SPAN&gt; caco_all = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; caco_lo = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; and caco_currentsmoker = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #0433ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt; caco_all = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px; color: #009193;"&gt;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10px;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; caco&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #0433ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; caco_all = &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #009193;"&gt;&lt;STRONG&gt;7&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any insight into alternatives in SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 13:59:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-Means-Equivocal-to-STATA/m-p/145568#M7612</guid>
      <dc:creator>epistats</dc:creator>
      <dc:date>2014-10-28T13:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted Means Equivocal to STATA?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-Means-Equivocal-to-STATA/m-p/145569#M7613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Include the interaction terms in the MODEL and LSMEANS statement, then look at the various level marginal LSMEANS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 19:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-Means-Equivocal-to-STATA/m-p/145569#M7613</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-10-29T19:35:14Z</dc:date>
    </item>
  </channel>
</rss>

