arl_stat
★    

India,
2017-02-13 07:58
(2600 d 03:54 ago)

Posting: # 17052
Views: 11,329
 

 SAS: Calculation of Geometric Mean [Software]

Hello Everybody,

Greetings !!!

My question is how to calculate geometric mean for untransformed data and individual concentration data using PROC GLM in SAS software for 2 way crossover study?

Thanks in advance. :-)
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2017-02-13 12:02
(2599 d 23:49 ago)

@ arl_stat
Posting: # 17054
Views: 10,196
 

 geomean()

Hi arl_stat

❝ My question is how to calculate geometric mean for untransformed data and individual concentration data using PROC GLM in SAS software for 2 way crossover study?

PROC GLM? :google:: geomean() does the job.

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
DavidManteigas
★    

Portugal,
2017-02-13 17:17
(2599 d 18:35 ago)

@ Helmut
Posting: # 17055
Views: 10,290
 

 geomean()

Hi Helmut,

geomean() won't solve the problem. A function could only be used within a data step or proc sql.

What the user is asking it is impossible (I think) to do within proc glm. The only way of obtaining geometric "LSmean" in proc glm is by using log-transformed data in the model statement as dependent variable.

It he/she intends to obtain geometric means from raw data, it could use either geomean within a proc sql query, use geomen within proc survey or by using proc summary in log-transformed data and the exponentiate the result in a data step.

Regards,
David
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2017-02-14 15:06
(2598 d 20:45 ago)

@ DavidManteigas
Posting: # 17056
Views: 10,138
 

 geomean()

Hi David,

THX for enlightening me! Since I’m not equipped with [image] I didn’t expect that it is sooo complicated. ;-)

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
d_labes
★★★

Berlin, Germany,
2017-02-14 16:39
(2598 d 19:12 ago)

@ Helmut
Posting: # 17057
Views: 10,032
 

 geomean() in SAS - crap

Dear Helmut, dear David,

❝ THX for enlightening me! Since I’m not equipped with [image] I didn’t expect that it is sooo complicated. ;-)


It is much more complicated as sooo, add some more ooooo :cool:.
You can use geomean() in SQL queries as David wrote,
proc SQL;
  select geomean(column) from data;
quit;

but it doesn't do anything, or at least not what one would expect, but gives me the column back, unchanged, and produces a warning:
WARNING: The GEOMEAN function has been called with only one argument. However, it is not an SQL
         aggregate function, and this call will not cause SQL aggregation.

What? Why to hell?

I don't understand why the SAS people have created such a crippled implementation of the geometric mean, only useful in a data step to calculate the geometric mean over more then one variable, row-wise. And nothing else.
Forget it :not really:! You have to roll your own.

Regards,

Detlew
DavidManteigas
★    

Portugal,
2017-02-15 11:50
(2598 d 00:02 ago)

@ d_labes
Posting: # 17060
Views: 9,940
 

 geomean() in SAS - crap

Dear d_labes,

You're absolutely right. Crappy implementation of SQL in SAS as usual, the function does not work even with a "group by" statement as ordinary arithmetic functions work. SAS "reads" data line by line and apply functions to each line. Therefore, this function seems even more useless than I actually thought.

Well, from my side I always use proc summary in log-transformed data to calculate geometric means and exponentiate the result. It's amazing how such a routinely used statistic is not avaliable as part of the "default" summary functions in SAS.
ElMaestro
★★★

Denmark,
2017-02-15 12:21
(2597 d 23:31 ago)

@ DavidManteigas
Posting: # 17061
Views: 9,968
 

 geomean() in SAS - crap

Hi David and Detlefff and other grumpy SAS users,

you get what you pay for.
Big money, big trouble:-D.

❝ You're absolutely right. Crappy implementation of SQL in SAS as usual, the function does not work even with a "group by" statement as ordinary arithmetic functions work. SAS "reads" data line by line and apply functions to each line. Therefore, this function seems even more useless than I actually thought.


Transpose the column, then geomean by SQL directly on the transpose, perhaps?

A

Pass or fail!
ElMaestro
DavidManteigas
★    

Portugal,
2017-02-15 14:06
(2597 d 21:46 ago)

@ ElMaestro
Posting: # 17062
Views: 9,964
 

 geomean() in SAS - crap

Hi can't imagine how efficient that would be if you have 5000 observations that you wish to transpose into 5000 new variables :-D
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2017-02-15 15:26
(2597 d 20:26 ago)

@ DavidManteigas
Posting: # 17064
Views: 9,913
 

 Efficiency – who cares?

Hi David,

❝ […] how efficient that would be […]



Who needs efficient software?
A friend of mine (in big pharma) had R-code for a large simulation study which completed overnight. The (US-based) company insisted in SAS (because SAS is “validated”…). SAS is poor in handling large datasets in RAM and starts to swap to the HD. Run-time was a couple of months. He had to buy another machine just to run the sim’s. Company was happy with that. Results were practically identical to what he already knew from R months earlier. :-D


Fast cars, fast women, fast algorithms …
what more could a man want?
    Joe Mattis

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
nobody
nothing

2017-02-15 16:22
(2597 d 19:30 ago)

@ Helmut
Posting: # 17065
Views: 9,910
 

 Efficiency – who cares?

...better safe than sorry...

:-D

SCNR

Kindest regards, nobody
DavidManteigas
★    

Portugal,
2017-02-15 17:12
(2597 d 18:39 ago)

@ Helmut
Posting: # 17066
Views: 9,879
 

 Efficiency – who cares?

Hi Helmut,

The problem with "validated software" is in people who does not know anything about "software validation" but always heard that SAS is the Industry standard.

I had issues like that sometimes. Clients asking for SAS instead of R since R is not "validated" (although base R is actually validated for use in clinical trials), even for observational studies. They usually understand the point when we send them a new quotation with the extra-fee for software license :-D
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2017-02-15 17:39
(2597 d 18:13 ago)

@ DavidManteigas
Posting: # 17067
Views: 9,888
 

 Efficiency – who cares?

Hi David,

❝ […] SAS is the Industry standard.


Yep – which doesn’t mean a thing. When it comes to spreadsheets, the Industry standard M$ Excel (preferred by the guy in the Armani suit) shows a lousy performance when it comes to statistics but Open Office and Gnumeric are excellent.

❝ They usually understand the point when we send them a new quotation with the extra-fee for software license :-D


That’s a splendid idea!

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
d_labes
★★★

Berlin, Germany,
2017-02-15 14:19
(2597 d 21:33 ago)

@ ElMaestro
Posting: # 17063
Views: 9,923
 

 Big money

Hi ElMaestro,

❝ you get what you pay for.

❝ Big money, big trouble:-D.


Absolutely correct :angry:.

Regards,

Detlew
UA Flag
Activity
 Admin contact
22,957 posts in 4,819 threads, 1,639 registered users;
86 visitors (1 registered, 85 guests [including 7 identified bots]).
Forum time: 11:52 CET (Europe/Vienna)

Nothing shows a lack of mathematical education more
than an overly precise calculation.    Carl Friedrich Gauß

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5