0

I am creating frequency tables to show children's heights at two different time points (doctor's visits--v1 & v2), compared against their age at the time of the first doctor's visit (age1).

I was able to create a two-way frequency table to show height and age at v1 by using:

mytable <- table(data$height1, data$age1, useNA = c ("always"))

Now, when I try to create a table that will show frequencies of heights at v1 + v2 by age at v1, I keep getting different kinds of errors. Some related to syntax, others to the fact that there are many missing values across all variables so the variables lengths are not the same.

Here are a few commands I have tried:

mytable2 <- table((data$height1 & data$height2), data$age1, useNA = c ("always"))

mytable2 <- table(data$height1, data$height2, data$age1, useNA = c ("always"))

Could anyone guide me? Please let me know if you need any more info on my part.

user20650
  • 24,654
  • 5
  • 56
  • 91
Ami
  • 1
  • I'd provide a bit more info to get a good answer. ie, can you give us a command and the resulting error that you get? – Mike Apr 17 '15 at 22:28
  • 1
    . Can you show some data ([or an minimum example of](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)) to help with giving an answer please – user20650 Apr 17 '15 at 23:30

0 Answers0