Closed GuyReeves closed 2 years ago
Depending on what class your 'sex' variable is, the internal code could be trying to make a factor out of sex, where it sets the first one to 1. The other possibility for this error could be that you're not giving the column names correctly. Either way, it might be best to set the sex of those that are obviously fathers and mothers (those whose ids are in the "father" and "mother" column) to 1 and 2, respectively, and make sure your sex variable is numeric, rather than a factor.
Ok I will check the column names which i think are correct and set all the specified mothers and fathers to 1 and 2, but the rest i shall leave as “3”.
On 17 Feb 2022, at 19:54, Jason Sinnwell @.***> wrote:
Depending on what class your 'sex' variable is, the internal code could be trying to make a factor out of sex, where it sets the first one to 1. The other possibility for this error could be that you're not giving the column names correctly. Either way, it might be best to set the sex of those that are obviously fathers and mothers (those whose ids are in the "father" and "mother" column) to 1 and 2, respectively, and make sure your sex variable is numeric, rather than a factor.
— Reply to this email directly, view it on GitHub https://github.com/mayoverse/kinship2/issues/6#issuecomment-1043302414, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJQTLAAX6HBWSACBP4JBJTU3U77LANCNFSM5OVQR7CA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.
I corrected the sex as suggested and the error disappeared. Thanks Guy
Hi
What does the error ""Mismatched lengths, id and sex" indicate? I was hoping to set all sex =3 ,as I I only want to calculate "Kinship" for autosomes and I figure sex does not matter.
Thanks
Guy
head of my input file
ped id father mother sex 1 B15_25 NA NA 3 1 B22_2 NA NA 3 1 B106_1 B15_25 B22_2 3 1 B106_2 B15_25 B22_2 3 1 B106_3 B15_25 B22_2 3 1 B106_4 B15_25 B22_2 3 1 B106_5 B15_25 B22_2 3