How to use the tablaStack function in R

Asked

Viewed 261 times

1

Good evening my Biostatistics teacher is teaching to use R, he passed the following question

(Construct frequency tables of RACE, MARITAL STATUS and SCHOOLING. Identify which categories of these variables stand out, do the separation by year. (Tip: use the command tableStack package epiDisplay. Use the YEAR as a variable that will cross all other).

But as much as I always try to make a mistake. Can anyone help me with this question?

inserir a descrição da imagem aqui using this photo as a database

  • Welcome to stack overflow. What command are you trying? And what’s the error message? See here some tips on how to improve your question.

1 answer

1

It would be nice if you put the code you are using and the error message that appears. See if the code below answers your question

library(epiDisplay)
dados <- data.frame(
  Num = 1:3, DIASEMANA = c("DOM", "DOM", "DOM"),
  DIA_obito = c(01,01,01), MES_obito = c("JAN", "JAN", "JAN"),
  ANO_obito = c(2006,2006,2006), 
  CLASSE_hora_obito = c("00:00 a 05:59", "00:00 a 05:59", "00:00 a 05:59"),
  IDADE_se_vivo = c(40,42,29), IDADE = c(32,34,20), 
  SEXO = c("M", "F", "M"), RACACOR = c(4,4,4), ESTCIV = c(2,2,1),
  ESC = c(5,5,4), LOCOCOR = c("Via publica", "Via publica", "Hospital"),
  BAIACOR = c("PONTA NEGRA", "PONTA NEGRA", "ADRIANOPOLIS"),
  ENDOCOR = c("ESTRADA DA PONTA NEG", "ESTRADA DA PONTA NEG", "RUA RECIFE"),
  CLASSE_CB = c("OUTROS ATT", "OUTROS ATT", "OUTROS ATT"))
tableStack(RACACOR:ESC, dados)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.