Skip to main content
Tweeted twitter.com/StackStats/status/1595024320228519937
Became Hot Network Question
deleted 18 characters in body; edited title
Source Link
Nick Cox
  • 59.5k
  • 8
  • 136
  • 212

Assessing homoneigeityhomogeneity of variances assumption for numeric variables

I'm fitting a model with a 2-level categorical and a numerical predictor. As far as I'm concerned, I cannot use car::LeveneTest() to assess homoscedasticity since I have a numerical predictor, right? What should I use instead to assess homoscedasticity on both numerical and categorical predictors?

  • expected error:
car::leveneTest(lmer(SCORE ~ EXAM_GRADE * TASK_TYPE + (1|ID), data = dfModels1, REML = F))

Error in leveneTest.default(lmer(SCORE ~ EXAM_GRADE  * TASK_TYPE + (1 |  : 
  lmer(SCORE ~ EXAM_GRADE  * TASK_TYPE + (1 | ID), data = dfModels1, REML = F) is not a numeric variable
  • head(dfModels1):

Each ID has a SCORE on two different TASKs. They also have a score on another Exam Grade. The basic idea is that Exam Grade predicts SCORE independenly of the task type.

ID      SCORE    EXAM_GRADE    TASK_TYPE    
  <chr>  <dbl>    <dbl>            <fct>         
1 1_101   7.1      100             A          
2 1_101   4.92     100             N   
1 2_101   7.4      36              A         
2 2_101   7        36              N   
  • Maybe the Breusch-Pagan test (such as performance::check_heteroscedasticity() does?)

  • Obs: I'm aware that I should prefer visual inspection instead, I'm also doing that, but I'd like to find a way to assess the assumption numerically as well just in case. Thanks in advance!

Assessing homoneigeity of variances assumption for numeric variables

I'm fitting a model with a 2-level categorical and a numerical predictor. As far as I'm concerned, I cannot use car::LeveneTest() to assess homoscedasticity since I have a numerical predictor, right? What should I use instead to assess homoscedasticity on both numerical and categorical predictors?

  • expected error:
car::leveneTest(lmer(SCORE ~ EXAM_GRADE * TASK_TYPE + (1|ID), data = dfModels1, REML = F))

Error in leveneTest.default(lmer(SCORE ~ EXAM_GRADE  * TASK_TYPE + (1 |  : 
  lmer(SCORE ~ EXAM_GRADE  * TASK_TYPE + (1 | ID), data = dfModels1, REML = F) is not a numeric variable
  • head(dfModels1):

Each ID has a SCORE on two different TASKs. They also have a score on another Exam Grade. The basic idea is that Exam Grade predicts SCORE independenly of the task type.

ID      SCORE    EXAM_GRADE    TASK_TYPE    
  <chr>  <dbl>    <dbl>            <fct>         
1 1_101   7.1      100             A          
2 1_101   4.92     100             N   
1 2_101   7.4      36              A         
2 2_101   7        36              N   
  • Maybe the Breusch-Pagan test (such as performance::check_heteroscedasticity() does?)

  • Obs: I'm aware that I should prefer visual inspection instead, I'm also doing that, but I'd like to find a way to assess the assumption numerically as well just in case. Thanks in advance!

Assessing homogeneity of variances assumption for numeric variables

I'm fitting a model with a 2-level categorical and a numerical predictor. As far as I'm concerned, I cannot use car::LeveneTest() to assess homoscedasticity since I have a numerical predictor, right? What should I use instead to assess homoscedasticity on both numerical and categorical predictors?

  • expected error:
car::leveneTest(lmer(SCORE ~ EXAM_GRADE * TASK_TYPE + (1|ID), data = dfModels1, REML = F))

Error in leveneTest.default(lmer(SCORE ~ EXAM_GRADE  * TASK_TYPE + (1 |  : 
  lmer(SCORE ~ EXAM_GRADE  * TASK_TYPE + (1 | ID), data = dfModels1, REML = F) is not a numeric variable
  • head(dfModels1):

Each ID has a SCORE on two different TASKs. They also have a score on another Exam Grade. The basic idea is that Exam Grade predicts SCORE independenly of the task type.

ID      SCORE    EXAM_GRADE    TASK_TYPE    
  <chr>  <dbl>    <dbl>            <fct>         
1 1_101   7.1      100             A          
2 1_101   4.92     100             N   
1 2_101   7.4      36              A         
2 2_101   7        36              N   
  • Maybe the Breusch-Pagan test (such as performance::check_heteroscedasticity() does?)

  • Obs: I'm aware that I should prefer visual inspection instead, I'm also doing that, but I'd like to find a way to assess the assumption numerically as well just in case.

Source Link

Assessing homoneigeity of variances assumption for numeric variables

I'm fitting a model with a 2-level categorical and a numerical predictor. As far as I'm concerned, I cannot use car::LeveneTest() to assess homoscedasticity since I have a numerical predictor, right? What should I use instead to assess homoscedasticity on both numerical and categorical predictors?

  • expected error:
car::leveneTest(lmer(SCORE ~ EXAM_GRADE * TASK_TYPE + (1|ID), data = dfModels1, REML = F))

Error in leveneTest.default(lmer(SCORE ~ EXAM_GRADE  * TASK_TYPE + (1 |  : 
  lmer(SCORE ~ EXAM_GRADE  * TASK_TYPE + (1 | ID), data = dfModels1, REML = F) is not a numeric variable
  • head(dfModels1):

Each ID has a SCORE on two different TASKs. They also have a score on another Exam Grade. The basic idea is that Exam Grade predicts SCORE independenly of the task type.

ID      SCORE    EXAM_GRADE    TASK_TYPE    
  <chr>  <dbl>    <dbl>            <fct>         
1 1_101   7.1      100             A          
2 1_101   4.92     100             N   
1 2_101   7.4      36              A         
2 2_101   7        36              N   
  • Maybe the Breusch-Pagan test (such as performance::check_heteroscedasticity() does?)

  • Obs: I'm aware that I should prefer visual inspection instead, I'm also doing that, but I'd like to find a way to assess the assumption numerically as well just in case. Thanks in advance!