rpietro / EsophagealCancerT1N0

Evaluating outcomes after Esophageal cancer T1N0
0 stars 0 forks source link

again recoding issue... #5

Closed mworni closed 12 years ago

mworni commented 12 years ago

I want to get another group into the variable div.

tab div

     div |      Freq.     Percent        Cum.

-------------+----------------------------------- loc therapy | 254 17.42 17.42 surg only | 957 65.64 83.06 both | 247 16.94 100.00 -------------+----------------------------------- Total | 1,458 100.00

this is what I have so far. What I would like to get is another group (subgroup from loc therapy) that had local therapy AND radiation therapy. So far, they are both included in the loc therapy group.

tab rad_surg_both div, m

rad_surg_b | div oth | loc thera surg only both | Total -----------+---------------------------------+---------- surg only | 217 957 0 | 1,174 both | 37 0 247 | 284 -----------+---------------------------------+---------- Total | 254 957 247 | 1,458

What I need to do is to get the 37 patients in the table above into the new group.

I tried the following:

div[resection='local destruction' & rad_surg_both='both'] <- local therapy with radiation Error: unexpected '=' in "div[resection='local destruction' & rad_surg_both="

I tried several other versions but none worked... with = instead of == ; without ' ', ...

rpietro commented 12 years ago

i don't have the same data set, please send me

btw, would comment everything that you don't use, such as View

On Thu, Jun 28, 2012 at 3:29 PM, mworni < reply@reply.github.com

wrote:

I want to get another group into the variable div.

tab div

    div |      Freq.     Percent        Cum.

-------------+----------------------------------- loc therapy | 254 17.42 17.42 surg only | 957 65.64 83.06 both | 247 16.94 100.00 -------------+----------------------------------- Total | 1,458 100.00

this is what I have so far. What I would like to get is another group (subgroup from loc therapy) that had local therapy AND radiation therapy. So far, they are both included in the loc therapy group.

tab rad_surg_both div, m

rad_surg_b | div oth | loc thera surg only both | Total -----------+---------------------------------+---------- surg only | 217 957 0 | 1,174 both | 37 0 247 | 284 -----------+---------------------------------+---------- Total | 254 957 247 | 1,458

What I need to do is to get the 37 patients in the table above into the new group.

I tried the following:

div[resection='local destruction' & rad_surg_both='both'] <- local therapy with radiation Error: unexpected '=' in "div[resection='local destruction' & rad_surg_both="

I tried several other versions but none worked... with = instead of == ; without ' ', ...


Reply to this email directly or view it on GitHub: https://github.com/rpietro/EsophagealCancerT1N0/issues/5

mworni commented 12 years ago

here is the dataset...

On Sun, Jul 1, 2012 at 4:02 AM, Ricardo Pietrobon < reply@reply.github.com

wrote:

i don't have the same data set, please send me

btw, would comment everything that you don't use, such as View

On Thu, Jun 28, 2012 at 3:29 PM, mworni < reply@reply.github.com

wrote:

I want to get another group into the variable div.

tab div

    div |      Freq.     Percent        Cum.

-------------+----------------------------------- loc therapy | 254 17.42 17.42 surg only | 957 65.64 83.06 both | 247 16.94 100.00 -------------+----------------------------------- Total | 1,458 100.00

this is what I have so far. What I would like to get is another group (subgroup from loc therapy) that had local therapy AND radiation therapy. So far, they are both included in the loc therapy group.

tab rad_surg_both div, m

rad_surg_b | div oth | loc thera surg only both | Total -----------+---------------------------------+---------- surg only | 217 957 0 | 1,174 both | 37 0 247 | 284 -----------+---------------------------------+---------- Total | 254 957 247 | 1,458

What I need to do is to get the 37 patients in the table above into the new group.

I tried the following:

div[resection='local destruction' & rad_surg_both='both'] <- local therapy with radiation Error: unexpected '=' in "div[resection='local destruction' & rad_surg_both="

I tried several other versions but none worked... with = instead of == ; without ' ', ...


Reply to this email directly or view it on GitHub: https://github.com/rpietro/EsophagealCancerT1N0/issues/5


Reply to this email directly or view it on GitHub:

https://github.com/rpietro/EsophagealCancerT1N0/issues/5#issuecomment-6690263

rpietro commented 12 years ago

I didn't undertand exactly what your difficulty was, but see whether this beginning will help you:

detach(T1N0_esoph_cancer) #detach to avoid the problems that come along with attaching levels(T1N0_esoph_cancer$div) #checking levels levels(T1N0_esoph_cancer$rad_surg_both) T1N0_esoph_cancer$new.div <- NA #start with missing T1N0_esoph_cancer$new.div[T1N0_esoph_cancer$rad_surg_both == "both" & T1N0_esoph_cancer$div == "loc therapy"] <- "simultaneous local and radiation" #create first category T1N0_esoph_cancer$new.div <- as.factor(T1N0_esoph_cancer$new.div) summary(T1N0_esoph_cancer$new.div)

code above will create the category you want and a bunch of missing values. you can then just assign the missing values to other categories you might want in this variable. the mechanism is always the same

couple comments:

  1. please comment everything you don't need to use just to avoid having the code running longer than it should, like View - this will allow me to get right into your problem and answer more quickly. bear in mind that i am no longer modifying your code to avoid the problems you had where you didn't save your data and i came in and made a mofication. i might need to go back and modify it directly (organize your script myself) since this is causing too much delay
  2. use short data object names as this will make it easier to manipulate. attaching the data often times causes problems and so when you are running code it is always best to use the $ sign, but that will generate a huge amount of code unless the name is short. in this case, i would call the data something like esoph

On Thu, Jun 28, 2012 at 3:29 PM, mworni < reply@reply.github.com

wrote:

I want to get another group into the variable div.

tab div

     div |      Freq.     Percent        Cum.

-------------+----------------------------------- loc therapy | 254 17.42 17.42 surg only | 957 65.64 83.06 both | 247 16.94 100.00 -------------+----------------------------------- Total | 1,458 100.00

this is what I have so far. What I would like to get is another group (subgroup from loc therapy) that had local therapy AND radiation therapy. So far, they are both included in the loc therapy group.

tab rad_surg_both div, m

rad_surg_b | div oth | loc thera surg only both | Total -----------+---------------------------------+---------- surg only | 217 957 0 | 1,174 both | 37 0 247 | 284 -----------+---------------------------------+---------- Total | 254 957 247 | 1,458

What I need to do is to get the 37 patients in the table above into the new group.

I tried the following:

div[resection='local destruction' & rad_surg_both='both'] <- local therapy with radiation Error: unexpected '=' in "div[resection='local destruction' & rad_surg_both="

I tried several other versions but none worked... with = instead of == ; without ' ', ...


Reply to this email directly or view it on GitHub: https://github.com/rpietro/EsophagealCancerT1N0/issues/5