title: Calculate The Demographic Incidence By Age And Sex
body: <p>Sample data</p>
  
  <pre><code>data = data.frame(id=c(1,2,3,4,5,6,7,8,9,10),
                    sex = c(0,1,1,1,1,1,0,0,0,0),
  age1=c(10,10,16,10,10,13,16,16,12,11),
  age2=c(12,12,18,12,12,15,18,18,14,13),
  age3=c(14,14,20,14,14,17,20,20,16,15),
  survey1=c(1,0,1,1,0,0,1,1,0,1),
  survey2=c(1,0,1,1,1,0,1,1,0,1),
  survey3=c(1,0,1,1,1,1,1,1,1,1))
  
  long = reshape(data, direction = "long",
                              varying = list(c("age1","age2","age3"),c("survey1","survey2","survey3")),
                              v.names = c("age","survey"),
                              idvar = "id", timevar = "year", times = c(2000,2002,2004))
  </code></pre>
  
  <p>Here my Objective is to estimate the age specific incident rate that is specific for age and estimated separate by sex. I have larger data but this is a fake data. </p>
  
  <p>I try to use "incidence" package</p>
  
  <pre><code>i.sex &lt;- incidence(long, interval = 2, group = sex, event = survey)
  </code></pre>
  
  <p>but this do not work.</p>
  
  <p>I see advice given by <a href="https://stackoverflow.com/users/889960/tim-riffe">https://stackoverflow.com/users/889960/tim-riffe</a> on a different but kind of related post if you have any advice. Thank you all </p>