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.
Re: Calculating median when comparing two continuous variables in a multivariate analysisI 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.
Re: Calculating median when comparing two continuous variables in a multivariate analysisI 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.
Re: Calculating median when comparing two continuous variables in a multivariate analysisI 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. 
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".

Y --> 1) med level 2) med dose
By --> a) list of meds b) e.g. sex

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.
Re: Calculating median when comparing two continuous variables in a multivariate analysisAnd 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".