{"id":2941,"date":"2013-01-18T05:41:55","date_gmt":"2013-01-18T10:41:55","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=2941"},"modified":"2013-01-18T05:41:55","modified_gmt":"2013-01-18T10:41:55","slug":"mixed-models-workshop-my-notes-in-tweets","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/mixed-models-workshop-my-notes-in-tweets\/","title":{"rendered":"Mixed Models Workshop &#8211; My notes in tweets"},"content":{"rendered":"<p>Wednesday, I went to a workshop, Mixed Models for Professors. It was a combination of discussion of the mathematics of mixed models, using SAS Enterprise Guide and examples for teaching. Since I was too lazy to actually take notes, I just tweeted it. Three useful pieces of advice, even if you don&#8217;t like my notes:<\/p>\n<ol>\n<li>SAS offers classes for professors for free several times a year. \u00a0I don&#8217;t know who you need to suck up to for an invitation.\u00a0I was not on their mailing list and now I am.<\/li>\n<li>The class notes book they give you is a great deal. It&#8217;s also free.<\/li>\n<li>If you live in southern California, there is a GLIMMIX class in June at National University.<\/li>\n<\/ol>\n<div>TWEETS OF MIXED MODELS<\/div>\n<p>Interaction in a mixed model &#8211; if at least one of the effects is random, the interaction is random<\/p>\n<p>Randomized complete block design &#8211; blocks are random, treatments are fixed.<\/p>\n<p>In randomized block design don&#8217;t take blocking variable out of the model even if it&#8217;s non-significant<\/p>\n<p>Analyzing a randomized block design? Need to have 1 observation per level of fixed effect per block. (Repeated records per block)<\/p>\n<p>&#8220;Repeat after me &#8211; I will never use PROC GLM again&#8221;<\/p>\n<p>Why would you find an interaction between block &amp; treatment if assignment was truly random?<\/p>\n<p>Kolmogorov-Smirnov is a test for significance of difference in vodka quality (ok, I lied it really tests normality)<\/p>\n<p>For random effects in\u00a0<a dir=\"ltr\" href=\"https:\/\/twitter.com\/search?q=%23SAS&amp;src=hash\" data-query-source=\"hashtag_click\"><s>#<\/s><strong>SAS<\/strong><\/a>\u00a0EG click random effects, then ADD, then click &#8230; to select effect (as in, click on three dots)<\/p>\n<p>Half the benefit of the\u00a0<a dir=\"ltr\" href=\"https:\/\/twitter.com\/search?q=%23SAS&amp;src=hash\" data-query-source=\"hashtag_click\"><s>#<\/s><strong>SAS<\/strong><\/a>\u00a0classes is the book of notes they give you. Like how the mixed one explains every bit of output. (It would be nice if it explained every option in the screens, too)<\/p>\n<p><a dir=\"ltr\" href=\"https:\/\/twitter.com\/search?q=%23SAS&amp;src=hash\" data-query-source=\"hashtag_click\"><s>#<\/s><strong>SAS<\/strong><\/a>\u00a0will also be offering a GLIMMIX workshop in San Diego in June, I hear. Really nice to have close to home<\/p>\n<p><a dir=\"ltr\" href=\"https:\/\/twitter.com\/search?q=%23SAS&amp;src=hash\" data-query-source=\"hashtag_click\"><s>#<\/s><strong>SAS<\/strong><\/a>\u00a0workshops for professors are free, just FYI<\/p>\n<p>Mixed models are robust to departures from normality &#8220;If it aint too bad&#8221;<\/p>\n<p>The larger your n, the harder to get normality because a larger n makes it easier to reject a slight departure from normality<\/p>\n<p>Two problems in regression &#8211; non-normality and non-constant variance<\/p>\n<p>In mixed models, non-constant variance can be accommodated, unlike in regression where we assume constant variance<\/p>\n<p>To inspect normality of residuals, look at quantile plots &lt;&#8211; sentence which made sense to me<\/p>\n<p>In mixed models errors are assumed to be neither independent nor homogeneous<\/p>\n<p>PROC MIXED allows for different covariance structures<\/p>\n<p>Fixed effects specified in MODEL statement. Random effects specified in RANDOM statement<\/p>\n<p>2 methods to obtain mixed estimates, maximum likelihood and restricted maximum likelihood (REML)<\/p>\n<p>In general REML estimators of the variance components are unbiased in PROC MIXED while ML estimates are biased low<\/p>\n<p>V = ZGZ&#8217; + R used in generalized least squares method<\/p>\n<p>&#8220;Kenward-Rogers degrees of freedom is Satterthwaite on steroids&#8221; &#8211; recommend as PROC MIXED df method. May give fractional df<\/p>\n<p><a href=\"http:\/\/www.amazon.com\/Generalized-Linear-Nonlinear-Models-Correlated\/dp\/1599946475\">Generalized Linear and Nonlinear Models for Correlated Data: Theory and Applications Using SAS<\/a>\u00a0by Vonesh. Recommended text.<\/p>\n<p>Nested effect &#8211; hierarchical data structure in which smaller experimental unit is nested within larger one, e.g., students within classes<\/p>\n<p>PROC GLM contrast statement uses &#8216;\/&#8217; where PROC MIXED uses &#8216;|&#8217;<\/p>\n<p>CONTRAST &#8216;3 levels&#8217; varname 1 -1 0 ; \u00a0= \u00a0How to write contrast statement in PROC MIXED to test diff between means of variable with 3 levels<\/p>\n<p>ESTIMATE &#8216;level 3 mean&#8217; int 1 varname 0 0 1 = estimates mean at lvl 3 for varname variable &#8211; how to code PROC MIXED ESTIMATE statement<\/p>\n<p>M1* is the average mean over all levels of M. (Sum of M11 &#8211; M1K)\/(number levels)<\/p>\n<p><a dir=\"ltr\" href=\"https:\/\/twitter.com\/search?q=%23SAS&amp;src=hash\" data-query-source=\"hashtag_click\"><s>#<\/s><strong>SAS<\/strong><\/a>\u00a0EG PROC MIXED does not include Type IV hypothesis test (never noticed that before)<\/p>\n<p>Should not use Type III SS when treatment combination is missing. What then?<\/p>\n<p>The answer to that last question is that there is no easy answer<\/p>\n<p>R(a|\u03bc b) testing for main effect a, adjusting for the intercept and main effect b, but is that really what you are doing?<br \/>\nReminder: Type I is model-order dependent while Type II, III are model order independent<\/p>\n<p>Recommends starting with the general model testing for unequal slopes and unequal intercepts<\/p>\n<p>in\u00a0<a dir=\"ltr\" href=\"https:\/\/twitter.com\/search?q=%23SAS&amp;src=hash\" data-query-source=\"hashtag_click\"><s>#<\/s><strong>SAS<\/strong><\/a>\u00a0EG on line plot go to INTERPOLATIONS under APPEARANCE and select REGRESSION to get a regression line<\/p>\n<p>PROC MIXED like ANOVA, GLM, interaction tests whether the slopes are equal. Main effect tests whether intercepts are equal<\/p>\n<p>random coefficient model includes term for variation around mean for level of the random effect<\/p>\n<p>PROC GLM ANCOVA assumes intercepts are fixed. Random coefficients model assumes they are random<\/p>\n<p>An effect can be considered both fixed and random (I did not know that)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wednesday, I went to a workshop, Mixed Models for Professors. It was a combination of discussion of the mathematics of mixed models, using SAS Enterprise Guide and examples for teaching. Since I was too lazy to actually take notes, I just tweeted it. Three useful pieces of advice, even if you don&#8217;t like my notes:&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-2941","post","type-post","status-publish","format-standard","hentry","category-statistics"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/2941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/comments?post=2941"}],"version-history":[{"count":2,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/2941\/revisions"}],"predecessor-version":[{"id":2943,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/2941\/revisions\/2943"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=2941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=2941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=2941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}