Take two children with similar backgrounds. Both are boys. They’re raised in families with the same socio-economic status. They live in similar-looking neighborhoods, and have the same access to ­education and health care.

The only difference is that one of the boys grows up in San Diego, where it’s comfortably warm for most of the year, and the average high temperature is about 70. The other is in Marquette, Mich., which is significantly colder. The average high there is just 50 degrees.

One of these kids is significantly more likely to be agreeable, open and emotionally stable, according to a new study, simply because he grew up in a warmer climate.

We know anecdotally that weather affects our mood. Summertime temperatures seem to lift our spirits, while the coldest weeks of winter put us in a funk. The study, which was published in Nature last week, says it does more than that, in the long run.

All else being equal, the San Diego kid is more likely to grow up friendlier, more outgoing and more willing to explore new things, the study suggests.

Alan Stewart, a University of Georgia psychology professor who wasn’t involved in the study, says this question — whether climate of a place relates to the physical or psychological quality of life — has been around for a long time.

“Does climate determine personality? I am not sure,” Stewart told the Post, “but from my own research, I do know that weather and ­climate affect mood, and this may be reflected in some of the authors’ assessments.”

Previous research has indeed linked geography to personality. “Midwest nice” and “New York abrasive” can be teased out of previous survey results, but it doesn’t necessarily explain why those personalities are dominant. The prevalence of disease and illness also tends to affect our personalities. National wealth plays a role in how our personalities evolve, too.

But no factor is as significant as the average temperature of the place we grew up.

Specifically, people who grew up in regions with average temperatures close to 72 degrees tend to be more agreeable, conscientiousness, emotionally stable, extroverted and open. These traits are what psychologists refer to as “the big five.”