search for: dfqtemp

Displaying 2 results from an estimated 2 matches for "dfqtemp".

2011 Apr 15
2
Function for deleting variables with >=50% missing obs from a data frame
...sing observations from the data frame (well, the actual percentage might change). I have already deleted from the data frame the variables that were all missing and for this I used the following code, which was kindly suggested by one of you: ## Data frame after removing any blank columns:dfQ <- dfQtemp[ , sapply(dfQtemp, function(x) !all(is.na(x)))] Any ideas or suggestons for deleting variables with partially missing data? Thanks and have a great weekend! Rita ===================================== "If you think education is expensive, try ignorance."--Derek Bok [[alte...
2011 Apr 01
0
package MICE, squeeze function, calling several variables at once
...#Read data into Rdf <- read.table("F:\\testC2S4\\new_C2-S4_head_data.txt", header = TRUE); #, stringsAsFactors = TRUEdfPZ <- df[ ,1:3]dfDV <- df[ ,277:311]dfPtemp <- df[ ,seq(4, 275, by = 2)]dfP <- dfPtemp[, sapply(dfPtemp, function(x) !all(is.na(x)))]dfQtemp <- df[ ,seq(5, 275, by = 2)]dfQ <- dfQtemp[, sapply(dfQtemp, function(x) !all(is.na(x)))]remove(dfPtemp, dfQtemp) NewPrimal <- data.frame(c(dfPZ, dfQ, dfP, dfDV), row.names = NULL, check.rows = F, check.names = F) remove(dfPZ, dfQ, dfP, dfDV) library(mice)# setting up the default settings...