Open EmmHee opened 1 year ago
You can use dplyr’s filter method to exclude NA values or complete.cases() in base R, subset() or a few other options in R. You’ll have to do that before you pass the data into the function.
It should work with categorical M, although there’s a bug somewhere I can’t figure out, but generally it works.
erin
From: EmmHee @.> Date: Monday, January 30, 2023 at 5:08 AM To: doomlab/MeMoBootR @.> Cc: Subscribed @.***> Subject: [doomlab/MeMoBootR] Missing data and categorical M (Issue #7)
Dear Dr. Erin M. Buchanan,
Thank you very much for developing this R package and providing code, examples, and more! It is so educational and I appreciate it greatly.
My data suffers missing data (in the dv), and I think it is why get the following error:
Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 122, 72 In addition: Warning messages: 1: In badmahal + badleverage : longer object length is not a multiple of shorter object length 2: In badmahal + badleverage + badcooks : longer object length is not a multiple of shorter object length
I did not manage to find an argument for excluding NAs; is that correct? Do you know if there is a way around this problem?
Furthermore, I wonder if the mediation1 function could be used for a categorical M? I have found the processR (catMediation) package, but again no argument for omitting/excluding NAs.
Thank you very much for your time.
Best regards, Emma
— Reply to this email directly, view it on GitHubhttps://github.com/doomlab/MeMoBootR/issues/7, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGT7FVSXLADFDU6NSG2V6O3WU6OLBANCNFSM6AAAAAAULAHMUU. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Thank you for your response! I will try it out.
Best regards, Emma
Hi Erin!
I managed to do the mediation analysis with a categorical M. I used the tidyr package to remove the NAs ( %>% drop_na() ). Thank you again for your support!
Oh! That’s a new one on me. Thanks for sharing.
erin
From: EmmHee @.> Date: Saturday, February 4, 2023 at 8:26 AM To: doomlab/MeMoBootR @.> Cc: The Doom Lab @.>, Comment @.> Subject: Re: [doomlab/MeMoBootR] Missing data and categorical M (Issue #7)
Hi Erin!
I managed to do the mediation analysis with a categorical M. I used the tidyr package to remove the NAs ( %>% drop_na() ). Thank you again for your support!
— Reply to this email directly, view it on GitHubhttps://github.com/doomlab/MeMoBootR/issues/7#issuecomment-1416766391, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGT7FVQYJ256NCCRHELYJULWVZRHXANCNFSM6AAAAAAULAHMUU. You are receiving this because you commented.Message ID: @.***>
Dear Dr. Erin M. Buchanan,
Thank you very much for developing this R package and providing code, examples, and more! It is so educational and I appreciate it greatly.
My data suffers missing data (in the dv), and I think it is why get the following error:
Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 122, 72 In addition: Warning messages: 1: In badmahal + badleverage : longer object length is not a multiple of shorter object length 2: In badmahal + badleverage + badcooks : longer object length is not a multiple of shorter object length
I did not manage to find an argument for excluding NAs; is that correct? Do you know if there is a way around this problem?
Furthermore, I wonder if the mediation1 function could be used for a categorical M? I have found the processR (catMediation) package, but again no argument for omitting/excluding NAs.
Thank you very much for your time.
Best regards, Emma