1
$\begingroup$

I have data of 11 years where for each year the values are binary (0 and 1). The sample sizes for each year are different (for example for 1989 n=8 and for 2004 n=30). The goal is to see if there is a trend in the ratio of 1's over the years (for example the ratio for 1989 would be 1/8). Can you suggest any method to do so?

Year    checks_at_least_one
1989    0
1989    1
1989    0
1989    0
1989    0
1989    0
1989    0
1989    0
1994    1
1994    0
1994    0
1994    0
1994    0
1994    0
1994    0
1994    0
1994    0
1995    0
1995    0
1995    0
1996    0
1996    0
1996    0
1996    1
1996    0
1996    0
1996    0
1996    0
1996    0
1996    0
1996    0
1996    0
1996    0
1996    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
1999    0
2004    1
2004    0
2004    1
2004    1
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2004    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    1
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2005    1
2005    0
2005    0
2005    0
2005    0
2005    0
2005    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    1
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    1
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2006    0
2009    1
2009    0
2009    0
2009    1
2009    1
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2009    0
2014    1
2014    1
2014    0
2014    1
2014    1
2014    1
2014    0
2014    1
2014    1
2014    1
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2014    0
2015    1
2015    0
2015    1
2015    0
2015    0
2015    1
2015    0
2015    0
2015    0
2015    0
2015    0
2015    0
2015    0
2015    0
2015    0
2015    1
2015    0
2015    1
2015    0
2015    0
2015    0
2015    0
2015    0
2015    1
2015    0
2015    1
2015    0
2015    0
2015    0
2015    0
2016    0
2016    1
2016    0
2016    1
2016    0
2016    0
2016    0
2016    0
2016    0
2016    0
2016    0
2016    0
2016    0
2016    1
2016    1
2016    0
2016    0
2016    0
2016    1
2016    1
2016    0
2016    0
2016    0
2016    0
2016    1
2016    0
2016    0
2016    0
2016    0
2016    0
$\endgroup$
  • $\begingroup$ What kid of trend are you expecting? How do you define the trend in binary data? If you are after linear trend, then you can simply use logistic regression. $\endgroup$ – Tim Sep 13 '16 at 14:02
  • $\begingroup$ I am expecting a linear trend of the ratio data (sum of ones divided by sample size for given data). If the sample size would be big enough for all years I would use linear regression, but since for some years my n is very small, I am not sure if it's the right thing to do. $\endgroup$ – Michael Sep 13 '16 at 15:11
1
$\begingroup$

If you expect a linear trend then I would suggest using logistic regression where proportion of successes are predicted by Year. This means that you are modeling the increase/decrease of probability of success over time. Given your data this leads to pretty nice fit over short term, but extrapolating it into more distant future would be risky, as such extrapolation is always risky (see plot below).

Values predicted by logistic regression vs data

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.