<?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: Proc means: mean of means in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829641#M35548</link>
    <description>&lt;P&gt;Hahaha, yes it is not really that variable, I tried to simplify the problem but it backfired... apologies!&lt;BR /&gt;&lt;BR /&gt;It is instead "condition" which is a categorical variable taking on 11 different values.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2022 12:29:54 GMT</pubDate>
    <dc:creator>linlin87</dc:creator>
    <dc:date>2022-08-22T12:29:54Z</dc:date>
    <item>
      <title>Proc means: mean of means</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829616#M35543</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;BR /&gt;&lt;BR /&gt;How do I get SAS to output mean of means as a dataset, without doing two proc means statements? I want calculate means between two study, but I want use the subject means to calculate this first. Currently I am doing by two proc means statements but is this long way the only way to do.&lt;BR /&gt;&lt;BR /&gt;Any help would be brilliant&lt;/P&gt;
&lt;PRE&gt;proc sort data=ffgorn_v6;													
by study subject;												
run;												
													
proc means data=ffgorn_v6 nway;													
class study subject;												
var abs diff ffhang;													
output out=means_1 Mean= /autoname;													
run;&lt;BR /&gt;&lt;BR /&gt;proc means data=means_1; &lt;BR /&gt;by study; &lt;BR /&gt;var abs_Mean diff_Mean ffhang_Mean;&lt;BR /&gt;output out=means_2 Mean= /autoname; &lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;Thank you!!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":sparkling_heart:"&gt;💖&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 07:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829616#M35543</guid>
      <dc:creator>linlin87</dc:creator>
      <dc:date>2022-08-22T07:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means: mean of means</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829634#M35545</link>
      <description>&lt;P&gt;UNTESTED, as I don't have your data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=ffgorn_v6;
    class subject study;
    model abs diff ffhang = study subject(study);
    lsmeans study;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The LSMEANS for study are I think what you want here.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 10:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829634#M35545</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-22T10:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means: mean of means</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829639#M35546</link>
      <description>&lt;P&gt;Thank you Paige. What does "subject(study)" do? I actually have another variable now that I want to add (sex). Should I therefore add the below?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;model abs = study subject(study) sex(study)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829639#M35546</guid>
      <dc:creator>linlin87</dc:creator>
      <dc:date>2022-08-22T11:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means: mean of means</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829640#M35547</link>
      <description>&lt;P&gt;Explain, in terms of your original problem, where sex impacts the analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless I am very wrong, the sex of a subject is uniquely determined by the subject; there can't be a situation where a subject has two different sexes, so I don't see why adding in sex is relevant here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;subject(study)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;indicates that subject is nested within study (rather than subjects being part of multiple studies)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829640#M35547</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-22T12:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means: mean of means</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829641#M35548</link>
      <description>&lt;P&gt;Hahaha, yes it is not really that variable, I tried to simplify the problem but it backfired... apologies!&lt;BR /&gt;&lt;BR /&gt;It is instead "condition" which is a categorical variable taking on 11 different values.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:29:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829641#M35548</guid>
      <dc:creator>linlin87</dc:creator>
      <dc:date>2022-08-22T12:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means: mean of means</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829642#M35549</link>
      <description>&lt;P&gt;This is not an explanation. This is simply changing the problem without an explanation.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So start over. Pretend this entire conversation has not happened. Do not refer to anything that has already been stated. From the beginning, describe the problem involving subject study and condition.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829642#M35549</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-22T12:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means: mean of means</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829670#M35557</link>
      <description>&lt;P&gt;Consider using the FEATURE of Proc Means /Summary&amp;nbsp; of doing multiple types of summaries at one time. Remove the NWAY and you will have summaries of 1) the data overall, 2) study, 3) subject and 4)study with subject. The _TYPE_ variable can be used to select the desired one (look at your output set).&lt;/P&gt;
&lt;PRE&gt;proc means data=ffgorn_v6 &lt;STRIKE&gt;nway&lt;/STRIKE&gt;;													
class study subject;												
var abs diff ffhang;													
output out=means_1 Mean= /autoname;													
run;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Aug 2022 14:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/829670#M35557</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-08-22T14:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means: mean of means</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/831076#M35606</link>
      <description>&lt;P&gt;OK, so the problem is as I described in another post. I have:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;data in;
input study $ subject device $ Yes_No Measure;
datalines;
A	1	a	1	348
A	1	a	0	1073
A	1	a	1	404
A	1	a	1	685
A	1	b	1	369
A	1	b	0	278
A	1	b	0	145
A	1	b	0	181
A	1	b	1	168
A	2	c	1	143
A	2	c	1	212
A	2	c	0	851
A	2	c	1	214
A	2	c	1	299
A	2	c	0	1201
A	2	d	0	406
A	2	d	0	124
A	2	d	1	953
A	2	d	0	169
A	2	d	0	783
A	3	e	1	153
A	3	e	1	151
A	3	e	0	217
A	3	e	0	313
A	3	e	0	864
A	4	f	1	5058
A	4	f	1	166
A	4	f	0	145
A	4	f	1	230
B	4	f	1	94
B	4	f	1	116
B	4	f	0	139
B	4	f	1	517
B	4	f	1	600
B	4	f	0	147
B	5	g	0	91
B	5	g	0	136
B	5	g	1	185
B	5	g	0	210
B	5	g	0	152
B	6	h	1	137
B	6	h	1	783
B	6	h	0	265
B	6	h	0	102
B	6	i	0	128
B	6	i	1	216
B	6	i	1	670
B	6	i	0	132
;
run;&lt;/LI-CODE&gt;
&lt;P&gt;and I want to work out the difference in "Measure" across study.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So device is nested within subject, and subject is nested in study.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 12:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/831076#M35606</guid>
      <dc:creator>linlin87</dc:creator>
      <dc:date>2022-08-30T12:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means: mean of means</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/831077#M35607</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=in;
    class study subject device;
    model measure = study subject(study) device(subject*study);
    lsmeans study subject(study) device(subject*study);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The LSMEANS are what you want.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 12:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-means-mean-of-means/m-p/831077#M35607</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-30T12:26:46Z</dc:date>
    </item>
  </channel>
</rss>

