Post hoc ergo propter hoc
Post hoc ergo propter hoc (Latin: "after this, therefore because of this") is an informal fallacy that states: "Since event Y followed event X, event Y must have been caused by event X." It is often shortened simply to post hoc fallacy.
Post hoc is a particularly tempting error because correlation appears to suggest causality. The fallacy lies in a conclusion based solely on the order of events, rather than taking into account other factors potentially responsible for the result that might rule out the connection.
A simple example is “the rooster crows immediately before sunrise; therefore the rooster causes the sun to rise.“
see also: