Shaun Tanner, a web developer and meteorologist, lives in San Jose, California, and works in Alameda, over an hour’s commute each way. His profession and location might indicate that Tanner is affluent, part of the storied Silicon Valley tech boom. But Tanner’s experience is quite different. He has a $3,000 monthly mortgage, less than half of his monthly income. Yet “week to week”, he says, he “still feels a crunch” on Fridays. “There’s nothing left here,” he says.

Until last September, Tanner had to work three jobs to pay for his health insurance and family’s expenses – as a meteorologist at Weather Underground, a rain-and-shine site, as an independent contractor, and as an instructor at San Jose State University. Now, he is down to working only two jobs, including laboring for what is called a “weather drone start-up”. (Cool! Scary!) Nonetheless, Tanner is still economically pressured, still commuting, and still heavily exerting himself to pay for three kids in after-school programs and daycare, all aged 10 and under.

“People see I work in the tech industry and they think I should be a multimillionaire,” Tanner explains. He’s not, needless to say. And living in the shadow of the tech industry has been even worse for some of his friends, he tells me, most of whom don’t have “ridiculous” tech jobs but whose costs of living are nonetheless full of “alienating” comparisons.

See the full visual

“Mr and Ms Jones of the Bay Area ask: ‘Am I doing as well as my neighbors?’” says Tanner. “It’s getting worse.”

Then there’s Amy, who has worked in human resources for over 18 years for different hi-tech Silicon Valley companies. She had struggled with the assumption that if you are working in and around Silicon Valley “you should be raking in six figures”. But it wasn’t the case for her line of work. She and her husband spent over half of their monthly income on their mortgage; childcare ate up another 30%.

Yet the couple were making $150,000 between the two of them. “Anywhere else in the country, that would be a ton of money,” she said. She also spent a large amount of time commuting because she couldn’t afford to live closer to her job. She “literally drove my kids out at 6am, to get them to daycare by 7, get into the office at 8.30, pick them up at 5 or 6, then we’d commute back, then bath, and food, and bed. I’d spend 15 minutes a day relaxing with them.” As she put it: “I didn’t make enough to get the cleaning lady or the chef like my colleagues did – my colleagues didn’t have time to clean for themselves or feed themselves, but they did have money.”

Her family’s cost of living was so high that after growing up in the Bay Area, she migrated to the Sacramento area. She now works out of her home in an unfashionable town, where she can spend time with her young children and is able to socialize with new friends who live nearby.

People may scoff at the concerns of Tanner and Amy and those like them, including the many public schoolteachers I have interviewed in the San Francisco area who are now forced to drive for Uber to be able to pay their rent. And sure, we might dismiss their complaints as the kvetching of the privileged. But we do so at the cost of misunderstanding human psychology and physiology, as well as losing solidarity with another group that is actually being harmed by inequality.

Try putting yourself in their place. The reality is that even upper-middle class life here stands on weak foundations.

Psychological and social science research supports that living amid the wealthy even when you are upper-middle class is pretty bad for your mental health. In 2010, a study by researchers at the University of Warwick and Cardiff University found that money improves happiness only if it also improves people’s social rank. In other words, being highly paid isn’t enough: people want to see progress in their lives, to feel as if they are moving up, and to be able to exhibit that ascension to people in their community and to themselves. Glenn Firebaugh and Matthew B Schroeder have also written on this phenomenon in a study entitled Does Your Neighbor’s Income Affect Your Happiness?

“With respect to income and happiness, what matters most is how much income a person has relative to his or her income comparison group,” the two scholars wrote.

The scholar danah boyd recently wrote about the need to understand the local perception of wealth, poverty, and status”. Like politics, all status is ultimately local – people compare themselves to those they live near. Americans overall may live better than medieval aristocrats could dream of, but that means nothing when oligarchs live in the neighborhood next door, flaunting their luxurious homes and top-quality private schools.

Like Thorstein Veblen before them, academics like the British researchers I mentioned earlier found that contentment is indeed relative – it’s dependent on how you see yourself in comparison with those you view as genuine peers. Even if you are middle class according to national averages, if you dwell in the hyper-wealthy areas of this country (all the richer thanks to inequality), you will probably find yourself struggling materially and emotionally. The fact that you know all too well that you should be grateful for what you have only makes it worse.

Take the private school teacher in New York City I interviewed, with two stepkids and a freelancer husband. She earns $90,000 a year. Her dad worked at a bank while her mom stayed at home during her early childhood, but her parents had a good mortgage and now live in a single-family home in Queens.

“I can’t imagine owning something worth what their home costs,” she says. (She’s wary of sharing her name because of her profession.) And that affects how her brain and body handle stress, because homeownership is her personal point of reference for a dignified existence.

To feel as though she is appropriately positioned and similar to her peers, she does spend on little luxuries, “ordering a glass of wine rather than just drinking water and using a credit card more often to pay for, say, hair color or highlights”. She adds: “I think of myself as poor bourgeois.”

Now in her mid-40s, she would like to have a child but “would never consider actually doing so, as I have no resources”. Part of the problem is her personal debt. Her credit card debt, for instance, equals $27,000. This all began because for years, she was making less and was unmarried.

“I was living by myself,” she says, “choosing to live on the Upper West Side,” an affluent area of Manhattan. Even though the rentals in the area were unaffordable, the costs associated with moving out were also prohibitive. “I wasn’t going to never buy clothes or never go out or never go on vacation. I’d just say ‘screw it’ and made a decision to put it on a credit card.” This might seem “objectively” foolish to a cold-eyed financial planner, but to many of us, especially those of us with stressed brains aiming for the minimum of relief and psychological comfort, these are not always luxuries.

In New York City, where I also live, people can complain about earning power when they make hundreds of thousands of dollars, boyd points out. She writes: “People’s understanding of prosperity is shaped by what they see around them.” And this affects their physical and mental health: it’s not just “failure to count your blessings” or the dreadful discourse around gratitude.

Again, how your income stacks up against others in the immediate community is more crucial in terms of satisfaction than income itself. This affects mental health but also, according to another 2014 study, physical health outcomes. Michael Daly, an associate professor in behavioral science at the University of Stirling, and his colleagues write that their data does “demonstrate that social position rather than material conditions may explain the impact of money on human health”.

And yet another study of the power of rank rather than absolute income cited an “evolutionarily based”, “involuntary defeat syndrome” in which low social rank opens people up to psychological disorders such as depression.

Essentially, if you are surrounded by those who “outrank” you, it is likely to affect your identity in insidious ways. Going in and out of a proverbial “poor door” – a separate entrance for income-restricted residents of mixed-income housing – of your city every day has its costs, even if the “poor door” woman would be considered affluent in another location. And again, the toll remains hidden because people, like the private school teacher, who are fiscally outranked are all too aware of not only others but also their own privilege. She and Tanner can feel precarious even their paychecks should make them solidly middle class – or even privileged. This is very much due to the cost of real estate in the San Francisco and New York City areas, with the median rent for an average two-bedroom apartment running tenants $4,560 in the former.

It makes Tanner long to escape, to become a minimalist, to move to the forest, to “live off the land”. I have those impulses, too. After all, those in the middle class, even in cities filled with elites, were once still properly “middle” – they weren’t all trying to keep up with the 1% or celebrities, and they did have more certainty and stability that made up in some way for their lower rank.

Now they – we – are stuck in the middle, as the song has it. The question remains of where to go from here.

Outclassed: the secret life of inequality, our new column about class, will run twice a month