rpietro / NSQIPageComplications

Analysis of surgical complications using the NSQIP data set
1 stars 1 forks source link

how can I get row percentages in this display? #4

Closed mworni closed 12 years ago

mworni commented 12 years ago

ftable(mortality_by_age_diagnosis)

using this command, I only get the raw numbers without percentages - I couldn't find an option for this % command.

rpietro commented 12 years ago

CrossTable(mortality_by_age_diagnosis)

would be best if you could keep all the recoding in one single section of your script, not only makes it easier to find, but also avoids that you have to run the models that are slow to get to the code you really want

On Sun, Jun 24, 2012 at 9:40 AM, mworni < reply@reply.github.com

wrote:

ftable(mortality_by_age_diagnosis)

using this command, I only get the raw numbers without percentages - I couldn't find an option for this % command.


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

mworni commented 12 years ago

This doesn't work - I got an error message saying that there is a wrong number of dimensions...

(I also have to change my Rstudio to english...)

CrossTable(mortality_by_age_diagnosis)

Cell Contents ------------------------- N Chi-square contribution N / Row Total N / Col Total N / Table Total

Total Observations in Table: 100829

         | numage10yrcatstart39
diagnosis 0 1 2 3 4 5 6 Row Total

Fehler in t[i, ] : falsche Anzahl von Dimensionen

On Mon, Jun 25, 2012 at 10:43 AM, Ricardo Pietrobon < reply@reply.github.com

wrote:

CrossTable(mortality_by_age_diagnosis)

would be best if you could keep all the recoding in one single section of your script, not only makes it easier to find, but also avoids that you have to run the models that are slow to get to the code you really want

On Sun, Jun 24, 2012 at 9:40 AM, mworni < reply@reply.github.com

wrote:

ftable(mortality_by_age_diagnosis)

using this command, I only get the raw numbers without percentages - I couldn't find an option for this % command.


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


Reply to this email directly or view it on GitHub:

https://github.com/rpietro/NSQIPageComplications/issues/4#issuecomment-6542346

rpietro commented 12 years ago

it's not the CrossTable but the way you created the variable. i saw your code:

mortality_by_age_diagnosis <- xtabs(~diagnosis+numage10yrcatstart39+ postopdeath)

but i am guessing that you wanted something other than the syntax you wrote. tell me what it is that you want i then i can write the syntax for you

On Mon, Jun 25, 2012 at 11:55 AM, mworni < reply@reply.github.com

wrote:

This doesn't work - I got an error message saying that there is a wrong number of dimensions...

(I also have to change my Rstudio to english...)

CrossTable(mortality_by_age_diagnosis)

Cell Contents ------------------------- N Chi-square contribution N / Row Total N / Col Total N / Table Total

Total Observations in Table: 100829

        | numage10yrcatstart39

diagnosis | 0 | 1 | 2 | 3 | 4 | 5 | 6 | Row Total |

-------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| Fehler in t[i, ] : falsche Anzahl von Dimensionen

On Mon, Jun 25, 2012 at 10:43 AM, Ricardo Pietrobon < reply@reply.github.com

wrote:

CrossTable(mortality_by_age_diagnosis)

would be best if you could keep all the recoding in one single section of your script, not only makes it easier to find, but also avoids that you have to run the models that are slow to get to the code you really want

On Sun, Jun 24, 2012 at 9:40 AM, mworni < reply@reply.github.com

wrote:

ftable(mortality_by_age_diagnosis)

using this command, I only get the raw numbers without percentages - I couldn't find an option for this % command.


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


Reply to this email directly or view it on GitHub:

https://github.com/rpietro/NSQIPageComplications/issues/4#issuecomment-6542346


Reply to this email directly or view it on GitHub:

https://github.com/rpietro/NSQIPageComplications/issues/4#issuecomment-6551249