search for: strsubset

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

2012 Jan 21
4
Create subset using variable
I am trying to create a loop that will perform a series of analyses. I am using geeglm from geepack, which fails if there are any null values. Creating a subset solves this, but do not seem to be able to set the subset dynamically based on a changing variable. while (j <= y.num) { strSubset = as.character(df.IV$IV[j]) #Gives column name in quotes df.data.sub = subset(df.data, strSubset>=0) #subset dataset is not created # analyses on subset take place j = j + 1 } If I type the variable name in the formula it works, so I assume that I am not creating the variable in...