- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data s ;
input a1-a3 ;
cards ;
5 10 5
10 20 10
;
proc sql ;
select avg(a1) as average from s ;
quit;
or
proc sql ;
select avg(of a1-a3) as average from s ;
quit;
by using proc sql i got average either column wise or row wise .
how to calculate average in datastep block?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@thanikondharish wrote:
data s ;
input a1-a3 ;
cards ;
5 10 5
10 20 10
;proc sql ;
select avg(a1) as average from s ;
quit;or
proc sql ;
select avg(of a1-a3) as average from s ;
quit;
by using proc sql i got average either column wise or row wise .
how to calculate average in datastep block?
The syntax for calculating row-wise average is not that different from the proc sql code. If you need to calculate column-wise average, using proc summary is most-times more efficient.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
there is difference between average and mean value i think so.
is there any difference between average and mean value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
At least in FedSQL functions avg and mean are the same:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@thanikondharish wrote:
proc summary gives mean value.
there is difference between average and mean value i think so.
is there any difference between average and mean value?
Only difference in general is spelling and how pedantic some users may be for vocabulary choices. Some uses of "average" have an interpretation of "typical" but in calculations average=mean for SAS. Of course "mean" can be used for "unkind".
Unless you are discussing geometric mean compared to arithmetic mean.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@thanikondharish wrote:
is there any difference between average and mean value?
NO.