| Date: | Fri, 5 Nov 2010 17:11:32 -0400 |
| Reply-To: | Nat Wooding <nathani@VERIZON.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Nat Wooding <nathani@VERIZON.NET> |
| Subject: | Re: using data from two data sets |
| In-Reply-To: | <001601cb7d29$4810e8f0$d832bad0$@com> |
| Content-Type: | text/plain; charset="US-ASCII" |
Well, if memory serves, you are calculating the corrected sums of squares so
why not let Proc Means do it all at once:
Data start;
input x ;
z= (x - 2.5)**2;
y + z;
cards;
1
2
3
4
;
Proc Means data = start;
output out = end css=css ;
var x;
run;
I threw in the y and z variables so that I could check the result.
Nat Wooding
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
bbser2009
Sent: Friday, November 05, 2010 4:38 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: using data from two data sets
For illustration, consider two data sets,
temp1
x
1
2
3
4
temp2 (the mean of x in temp1)
mean
2.5
Now I would like to sum all the squares like this:
(1-2.5)**2+(2-2.5)**2+...
Apparently we need data from the two different data sets, but I do not want
to combine the two into one.
I just need to do this in one data step, where I can read from the data sets
and do the computation.
Could you help me with this? Thanks.
Regards, Max
|