Question: I'm trying to calculate 14-day trends in COVID-19 infections and deaths (as shown on the NYTimes homepage). I want to do this on a state level and have access to each state's population and daily data about the covid infections/ deaths in that state <https://docs.google.com/spreadsheets/u/2/d/e/2PACX-1vRwAqp96T9sYYq2-i7Tj0pvTf6XVHjDSMIKBdZHXiCGGdNC0ypEU9NbngS8mxea55JuCFuua1MUeOj5/pubhtml#>

What's the best way to calculate these 14-day trends? And is a 14-day trend the same as a rate?
[![i](https://i.stack.imgur.com/a0JUN.png)](https://i.stack.imgur.com/a0JUN.png)

Answer: 
> 
> why logistic regression classifies them wrongly and at least does not involve one of the small clusters?
> 
> 
> 

The center clusters (red and blue) have a wide spread on x2.

Adding regularization will also be better.

> 
> How should I rearrange the red clusters to reduce the misclassification?
> 
> 
> 

This means we can change our data to make the performance better. I think this is cheating in real world. But for learning purposes, it is a perfect question.

My answer is if we move one of the small red clusters higher (say, make the red cluster on right side to be centered around 0,0.25), it will definitely fix the problem.
I realise this is a little late to the party, but I just had a similar issue with a logistic regression model of my own and wanted to understand why it wasn't at least orienting the decision plane to include more data-points and/or basing the minimum misclassification boundary more favourably. I was using iterated reweighted least squares fitting (Rubin, 1983) but where I had implemented this myself.

For me, I was getting very similar results to Raz (with a different arrangement of data-points). Namely, the decision plane didn't seem best oriented and the minimum misclassification boundary (at posterior probability 0.5) wasn't in the best position (I could change the threshold at which I drew the boundary and improve the accuracy). These strange characteristics seemed to arise because I had forgotten to include a bias term in my model (or a constant bias column in my data). Adding this in I began to see the anticipated results.

If anyone sees this behaviour themselves, I suggest you check to see that your bias term is properly included.

**References**

D. B. Rubin, Iteratively Reweighted Least Squares , Encycl. Stat. Sci. 33 (1983), 7–17.