Re: [R] Looping survdiff

2012-10-19 Thread Charles Determan Jr
Thank you for all your responses, I assure you this is not homework. I am a graduate student and my classes are complete. I am trying multiple different ways to analyze data and my lab requests different types of scripts to accomplish various tasks. I am the most computer savy in the lab so it c

Re: [R] Looping survdiff

2012-10-19 Thread Terry Therneau
The number of recent questions from umn.edu makes me wonder if there's homework involved Simpler for your example is to use get and subset. dat <- structure(.as found below var.to.test <- names(dat)[4:6] #variables of interest nvar <- length(var.to.test) chisq <- double(nvar) for (

Re: [R] looping survdiff?

2012-10-19 Thread Andrews, Chris
18, 2012 3:04 PM To: r-help@r-project.org Subject: [R] looping survdiff? Hello, I am trying to set up a loop that can run the survdiff function with the ultimate goal to generate a csv file with the p-values reported. However, whenever I try a loop I get an error such as &quo

[R] looping survdiff?

2012-10-18 Thread Charles Determan Jr
Hello, I am trying to set up a loop that can run the survdiff function with the ultimate goal to generate a csv file with the p-values reported. However, whenever I try a loop I get an error such as "invalid type (list) for variable 'survival_data_variables[i]". This is a subset of my data: str