-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing data and categorical M #7
Comments
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 GitHub<#7>, or unsubscribe<https://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, |
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 GitHub<#7 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGT7FVQYJ256NCCRHELYJULWVZRHXANCNFSM6AAAAAAULAHMUU>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: