I conducted a diary study in which for 5 days, participants had to answer to 2 times.
My criteria was that people had to answer to at least 3 full days out of the 5. So, that from the overall 10 times in which the questionnaire took place, they had to answer to at least 6 times. Everytime they filled in the questionnaire they had to put a personal code, which is why I can see who answered and how many times.
I put like this:
Morning_Afternoon_PT_EN: is the name of the database
respfreq <- calc.nomiss(Morning_Afternoon_PT_EN$day, tolower(Morning_Afternoon_PT_EN$code), data=Morning_Afternoon_PT_EN) print(respfreq) length(respfreq)
length(respfreq) [1] 56
So, I see that "952345172", "chno45", "limf96","liabr14","life74", "fude38" do not meet the requiremente and I want to eliminate them from the overall data base.
I tried to use subset, like:
NewDataFrame<-subset(Morning_Afternoon_PT_EN, respfreq>6)
But, I get the answer:
NewDataFrame<-subset(Morning_Afternoon_PT_EN, respfreq>6)
Error: Must subset rows with a valid subscript vector. i Logical subscripts must match the size of the indexed input. x Input has size 485 but subscript r
has size 56.
I understand the error, but idk how to solve it.
Thanks!