0

I did a diary study. It was 5 days, 2 times a day (morning and afternoon).

Morning measures I have:

sleeping problems Afternoon measures I have:

Emotions Incivility I want to test a mediation. First I want to teste the model with just the IV. But, when I do this on R:

summary(m1 <- lmer(sleepingproblems ~ incivility + (1 + incivility |code), data = data_within_measures))

I get the error: **Error in h(simpleError(msg, call)) : ** ** error in evaluating the argument 'object' in selecting a method for function 'summary': missing value where TRUE/FALSE needed **

I get the error. The reason is that because in the morning I only have measures for SP and in the afternoon I only have data for incivility, so they don´t match. But I don´t know how to solve it. I would like to know if there is a way I can match both (e.g. matching the data from day 1 morning with the afternoon data, and so on). The idea is to see whether who experiences incivility will most likely experience sleeping problems as well.

head(base_within_merged,6)[,c("code","register","sleepingproblems","expf2fwi","emotionalreactivity")]

code register sleepingproblems expf2fwi emotionalreactivity 1 aaja28 7 1.8 NA NA 2 aaja28 8 NA 1 1.000000 3 aaja28 5 2.0 NA NA 4 aaja28 6 NA 1 2.666667 5 aaja28 10 NA NA NA 6 aaja28 3 2.6 NA NA

library (nlme) library (lme4)

m1 <- lmer(sleepingproblems ~ expf2fwi + (1|code), data = base_within_merged)

Error in lme4::lFormula(formula = sleepingproblems ~ expf2fwi + (1 | code), :0 (non-NA) cases

I appreciate the help! Thank you!

0 Answers0