search for: scq40

Displaying 1 result from an estimated 1 matches for "scq40".

Did you mean: sc440
2011 Nov 19
1
Advice on recoding a variable depending on another which contains NAs
...et the final score to SCQScore1 for these. [[This is a debatable choice, but I am not asking your advice on that choice!]] d$SCQScore <- 99 ##Distinct value for any other values I've missed d$SCQScore[SCQ1 == 1] <- d$SCQScore1[SCQ1 == 1] ## Talks using phrases/sentences, so sum S2CQ:SCQ40 d$SCQScore[SCQ1 == 2] <- d$SCQScore2[SCQ1 == 2] ## Can't do this, so sum SCQ8:SCQ40 d$SCQScore[is.na(d$SCQ1)] <- d$SCQScore1 [is.na(d$SCQ1)] ## SCQ1 is missing This fails on line 2 (d$SCQScore[SCQ1 == 1] <- d$SCQScore1[SCQ1 == 1]) with the error message "NAs are not allowed...