'Code for multiple correlation is not working, where is the issue?
The goal is to perform correlation analyses to see if grade, iq, mathcomp and placement are associated with readcomp in the Learndis dataset and the question to be answered is "Does the correlation between reading achievement and math competence differ significantly for boys vs. girls?"
library(sur)
library(cocor)
Learndis <- (Learndis)
Learndis %>%
pull(gender) %>%
split(Learndis,.)
Learndis[,c(4,5)] <- Learndis %>%
select(c(readcomp, mathcomp)) %>%
lapply(as.double)
Learndis %>%
pull(gender) %>%
split(Learndis,.)
Learndis %>%
cocor(~readcomp + mathcomp | readcomp + mathcomp, .)
I receive the error "Error in cocor(~readcomp + mathcomp | readcomp + mathcomp, .) : For correlations based on dependent groups, the parameter 'formula' must be a formula of the form ~a + b | a + c if the two correlations are overlapping or ~a + b | c + d if the two correlations are nonoverlapping."
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
