Bioequivalence and Bioavailability Forum

Main page Policy/Terms of Use Abbreviations Latest Posts

 Log-in |  Register |  Search

Back to the forum  Query: 2017-02-27 10:10 CET (UTC+1h)
 
arl_stat
Junior

India,
2017-02-13 06:58

Posting: # 17052
Views: 716
 

 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
Hero
Homepage
Vienna, Austria,
2017-02-13 11:02

@ arl_stat
Posting: # 17054
Views: 642
 

 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.

[image]All the best,
Helmut Schütz 
[image]

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

Portugal,
2017-02-13 16:17

@ Helmut
Posting: # 17055
Views: 619
 

 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
Hero
Homepage
Vienna, Austria,
2017-02-14 14:06

@ DavidManteigas
Posting: # 17056
Views: 511
 

 geomean()

Hi David,

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

[image]All the best,
Helmut Schütz 
[image]

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

Berlin, Germany,
2017-02-14 15:39

@ Helmut
Posting: # 17057
Views: 503
 

 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
Junior

Portugal,
2017-02-15 10:50

@ d_labes
Posting: # 17060
Views: 443
 

 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
Hero

Denmark,
2017-02-15 11:21

@ DavidManteigas
Posting: # 17061
Views: 435
 

 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

I could be wrong, but…


Best regards,
ElMaestro


Here's the good news, folks: If you leave operational excellence, (c)LEAN, six sigma and management consultancy firms out of your development programmes, then you may have a chance to be first to market and to beat your competitors.
DavidManteigas
Junior

Portugal,
2017-02-15 13:06

@ ElMaestro
Posting: # 17062
Views: 425
 

 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
Hero
Homepage
Vienna, Austria,
2017-02-15 14:26

@ DavidManteigas
Posting: # 17064
Views: 416
 

 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

[image]All the best,
Helmut Schütz 
[image]

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

2017-02-15 15:22

@ Helmut
Posting: # 17065
Views: 394
 

 Efficiency – who cares?

...better safe than sorry...

:-D

SCNR

Kindest regards, nobody
DavidManteigas
Junior

Portugal,
2017-02-15 16:12

@ Helmut
Posting: # 17066
Views: 379
 

 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
Hero
Homepage
Vienna, Austria,
2017-02-15 16:39

@ DavidManteigas
Posting: # 17067
Views: 376
 

 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!

[image]All the best,
Helmut Schütz 
[image]

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

Berlin, Germany,
2017-02-15 13:19

@ ElMaestro
Posting: # 17063
Views: 422
 

 Big money

Hi ElMaestro,

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

Absolutely correct :angry:.

Regards,

Detlew
Back to the forum Activity
 Thread view
Bioequivalence and Bioavailability Forum | Admin contact
16,618 Posts in 3,572 Threads, 1,006 registered users;
18 users online (1 registered, 17 guests).

Philosophy, like medicine, has plenty of drugs, few good remedies,
and hardly any specific cures.    Sebastien-Roch Nicolas de Chamfort

The BIOEQUIVALENCE / BIOAVAILABILITY FORUM is hosted by
BEBAC Ing. Helmut Schütz
XHTML/CSS RSS Feed