[R] random effects model

arun smartpink111 at yahoo.com
Sun Jan 13 00:17:57 CET 2013


Hi,
Yes, you are right.  72.655222% was those missing among females.  35.14377% of values in females are missing from among the whole dataset (combined total of Males+Females data after removing the NAs from the variable "Sex"). 
A.K.



________________________________
From: Usha Gurunathan <usha.nathan at gmail.com>
To: arun <smartpink111 at yahoo.com> 
Cc: R help <r-help at r-project.org> 
Sent: Saturday, January 12, 2013 5:59 PM
Subject: Re: [R] random effects model


Hi AK
That works. I was trying to get  similar results from any other package. Being a beginner, I was not sure how to modify the syntax to get my output.

lapply(split(BP_2bSexNoMV,BP_
2bSexNoMV$Sex),function(x) (nrow(x[!complete.cases(x[,-2]),])/nrow(x))*100) #gives the percentage of rows of missing #values from the overall rows for Males and Females
#$Female
#[1] 72.65522
#
#$Male
#[1] 74.47401

#iF you want the percentage from the total number rows in Males and Females (without NA's in the the Sex column)
 lapply(split(BP_2bSexNoMV,BP_2bSexNoMV$Sex),function(x) (nrow(x[!complete.cases(x[,-2]),])/nrow(BP_2bSexNoMV))*100)
#$Female
#[1] 35.14377
#
#$Male
#[1] 38.45048

How do I interpret the above 2 difft results? 72.66% of values were missing among female participants?? Can you pl. clarify.

Many thanks.


On Sun, Jan 13, 2013 at 3:28 AM, arun <smartpink111 at yahoo.com> wrote:

lapply(split(BP_2bSexNoMV,BP_2bSexNoMV$Sex),function(x) (nrow(x[!complete.cases(x[,-2]),])/nrow(x))*100) #gives the percentage of rows of missing #values from the overall rows for Males and Females
>#$Female
>#[1] 72.65522
>#
>#$Male
>#[1] 74.47401
>
>#iF you want the percentage from the total number rows in Males and Females (without NA's in the the Sex column)
> lapply(split(BP_2bSexNoMV,BP_2bSexNoMV$Sex),function(x) (nrow(x[!complete.cases(x[,-2]),])/nrow(BP_2bSexNoMV))*100)
>#$Female
>#[1] 35.14377
>#
>#$Male
>#[1] 38.45048




More information about the R-help mailing list