cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
mmkaz
Level II

Calculating median when comparing two continuous variables in a multivariate analysis


Dear JMP Board,

 I am currently working on a biomedical dataset comparing doses and blood levels of four different medication. My PI instructed me in short to compare the data for each blood level and dose across different subgroups (male, female; pre-, post-pubescent etc.). Practically spoken he told me to use a multivariate analysis to calculate a p vale within groups (Y = Dose + blood level data by medicaments and e.g. sex or ethnicity or age). To calculate p value within groups I used a standard Spearmans test. Additionally to that, he asked me to calculate each the median for dose and blood level but both of us didn't really know how... All I found so far was a way to calculate a mean value for each when using a multivariate analysis.  So we both thought it might be best to ask people who are more acquainted with JMP and thus I am reaching out to anyone who might know better.
Thanks for any help, much appreciated! 
I am currently using macOS Big Sur 11.6 and JMP version 16.0.0.
2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Calculating median when comparing two continuous variables in a multivariate analysis

I warn against analyzing sub-groups of data in such a case. You dramatically weaken the power of any hypothesis tests. You are also likely to miss effects such as interactions that might be important.

 

Also, non-parametric tests have less power than parametric tests when the assumptions of the parametric test hold.

 

I suggest that you try modeling the mean response using multiple regression and then analyze the residuals to assess how well the data meet the assumptions of regression. You model might by blood level = intercept + dose + sex + age + ... + dose*sex + dose*age + ... and model all the data together.

 

See this chapter in the JMP Help for more information and examples.

View solution in original post

Re: Calculating median when comparing two continuous variables in a multivariate analysis

Select the Add Aggregate Statistics option near the bottom on the left side:

 

tab.PNG

View solution in original post

7 REPLIES 7
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Calculating median when comparing two continuous variables in a multivariate analysis

I read through this a few times now and I am struggling to understand what you are trying to do. Calculating a mean and median in the context of a multivariate analysis doesn't really make sense to me.  The distribution platform would help you calculate medians and means and in tabulate you could group these different ways.  Are you perhaps trying to find the residual of a value after accounting for the effect or correlation of other variables?

 

An example might help.

mmkaz
Level II

Re: Calculating median when comparing two continuous variables in a multivariate analysis

I am being honest with you, I cannot really say neither. As I said I am mostly working according to what my PI instructs me to do. But I can post a screenshot of the table I was asked to work on. Bildschirmfoto 2021-10-20 um 10.48.30.png
Basically I use a multivariate analysis to calculate the correlation coefficient and p-value within group via Spearmans. And the question is how to calculate "mean dose" and "mean blood level".


Bildschirmfoto 2021-10-20 um 10.57.51.png
Y --> 1) med level 2) med dose 
By --> a) list of meds b) e.g. sex 

Bildschirmfoto 2021-10-20 um 11.09.06.png

and I was looking for a way to find a median here in the list of commands. Since you can access the mean value via "simple statistics" 

I use Fit model to calculate p value across groups and y by x to for
"N" --> *number of blood draws post-baseline with available information about antipsychotic dose and blood level (maximum 3 time points per patient, i.e. at week 4, 8 and 12).
Thats all the information I can provide. 

mmkaz
Level II

Re: Calculating median when comparing two continuous variables in a multivariate analysis

And the question is how to calculate "mean dose" and "mean blood level". 

I meant "and the question is how to calculate "median dose" and "median blood level". 

Re: Calculating median when comparing two continuous variables in a multivariate analysis

It seems you have found most of what you want and how to ask JMP for it.

 

As for the median levels, the Tabulate platform is a versatile summary tool. Select Analyze > Tabulate to start. It is a drag and drop tool. Variables are used to group data or to analyze. I opened the Big Class data table in the Sample Data folder to use height and weight instead of your actual Dose and Blood Level variables. I used age and sex as grouping variables. Here is the data table:

 

table.PNG

 

Here is the result in Tabulate:

 

tabulate.PNG

 

You can learn how to use Tabulate in this chapter from the JMP Help. I hope that this reply helps with your remaining questions!

mmkaz
Level II

Re: Calculating median when comparing two continuous variables in a multivariate analysis

Thank you! Though one question, maybe I missed out that part: Where can I find the overall median for dose and level (for each male and female as a whole) in this interface? 

Re: Calculating median when comparing two continuous variables in a multivariate analysis

Select the Add Aggregate Statistics option near the bottom on the left side:

 

tab.PNG

Re: Calculating median when comparing two continuous variables in a multivariate analysis

I warn against analyzing sub-groups of data in such a case. You dramatically weaken the power of any hypothesis tests. You are also likely to miss effects such as interactions that might be important.

 

Also, non-parametric tests have less power than parametric tests when the assumptions of the parametric test hold.

 

I suggest that you try modeling the mean response using multiple regression and then analyze the residuals to assess how well the data meet the assumptions of regression. You model might by blood level = intercept + dose + sex + age + ... + dose*sex + dose*age + ... and model all the data together.

 

See this chapter in the JMP Help for more information and examples.