2
$\begingroup$

This is not about my own data, but I was asked for advice regarding the following situation:

A researcher has given a certain self-report instrument to a sample of participants. They want to see whether there are gender and age differences in the scores, but they believe that the gender and age effects on the score will be different for participants who score below a certain threshold (let's say 100 points) on this instrument vs. above this threshold, and would like to investigate this.

The only way I come up with is to create a binary variable indicating whether the participant scored below or above 100 points, and include interactions between gender and age and this variable, but that can't be right because surely a variable based on the dependent variable should not be put in as predictor? But what would be the way to do this, or is there any way?

$\endgroup$

1 Answer 1

4
$\begingroup$

I prefer not to dichotomize continuous data whenever it is not strictly necessary. It seems you want to know what the relationship between your predictors and the outcome are given a specific set of value that is considered high. You could still do this in a continuous way without having to waste or distort information by dichotomizing.

This could perhaps be modeled instead with a quantile regression, where the conditional quantile, $\tau$, of interest is set at a value near the threshold you mention here (perhaps $Y = 100$ is around $\tau = .90$). This would allow you to estimate the response in a continuous way while still "borrowing" data from the rest of the distribution.

I simulated some data in R that matches what you describe, and then fit that data to the 90th quantile here.

#### Set Seed and Load Libraries ####
set.seed(123)
library(quantreg)
library(ggeffects)

#### Simulate Data ####
n <- 5000
age <- rnorm(n, mean = 50, sd = 10)
gender <- rep(c(0,1), each = n/2)
response <- 15 + 3*gender + .20 * age + rnorm(n)
df <- data.frame(age,gender,response)

#### Fit Model ####
tau <- .9
fit <- rq(response ~ age + gender, tau = tau)
summary(fit)

#### Plot Model ####
pred <- ggpredict(fit, terms = c("age","gender"))
plot(pred, show_data = T)

The plotted model looks like this:

enter image description here

You can see that for this data, the regression line is plotted to represent the conditional distribution of the relationship between our two predictors and response at levels that are considered high in the response (notice the location of the regression line is near the "top" of each cloud), rather than the typical line through the middle of the data cloud (for the conditional mean).

If you are curious about the actual interaction between each quantile, you can also just fit multiple quantiles (here $\tau = [.1, .9]$), where I just plot from ggplot() for simplicity.

#### Library ####
library(tidyverse)

#### Set Full Range of Tau ####
tau_full <- seq(.1,.9,by=.1)

#### Plot Values ####
df %>% 
  ggplot(aes(x=age,response))+
  geom_point(color = "gray")+
  stat_quantile(quantiles = tau_full, color = "black")+
  facet_wrap(~ gender)

enter image description here

$\endgroup$
5
  • $\begingroup$ Thanks! My question was not so much about dichotomizing - the dependent would not be dichotomized - but whether and how to use information from the dependent variable at the predictor side. Quantile regression may indeed work. $\endgroup$
    – Sointu
    Commented Nov 4 at 10:02
  • 1
    $\begingroup$ Gotcha. I have edited my answer to include how you can also just compare multiple quantiles. It could be that the slope between age and response changes as a consequence of both gender and the quantile, where you could directly compare the quantile you are interested in to the others. $\endgroup$ Commented Nov 4 at 10:05
  • 1
    $\begingroup$ Thanks, I'll check it out. Another problem is that the person asking will probably not be able to run a quantile regression independently. I'll see if someone else also has a suggestion, but this is good. $\endgroup$
    – Sointu
    Commented Nov 4 at 10:06
  • 3
    $\begingroup$ I agree with Shawn about quantile regression (+1). If the person is using SAS, I wrote a paper on PROC QUANTREG (googling my name and "quantreg" should find it). But, often, people really should hire an expert to do the stats. $\endgroup$
    – Peter Flom
    Commented Nov 4 at 11:22
  • $\begingroup$ Sadly they use SPSS, but the paper will be helpful to me, thank you Peter! $\endgroup$
    – Sointu
    Commented Nov 4 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.