While inflation has weighed on the stock market this year and called into question the outlook for corporate earnings in 2023, there are still some stocks that have proven resilient. The three major stock indexes are poised to end the year lower as investors have grown increasingly wary of a looming recession. Still, there are plenty of individual stocks whose businesses are fundamentally performing well, improving their profit margins even at a time when inflation is running at a 40-year high. As a result, analysts and strategists say there are still opportunities to profit by carefully choosing stocks, even in a bear market. With this in mind, CNBC Pro screened for companies that have increased their gross profit margin by at least one percentage point in each of the last three quarters. Gross margin measures a company’s remaining profit after subtracting all costs related to its products or services. The list was also filtered to only include stocks that have “buy” ratings from at least 70% analysts covering the company, and have an average price target at least 10% higher than current prices. Diamondback Energy made the list, showing accelerating gross margins in recent quarters. Its performance aligns with the broader energy sector, which has surged this year following the Russian invasion of Ukraine. The S & P 500 energy sector, which has added about 60%, is the only major group, out of 11, that’s advanced in the benchmark index in 2022. Despite underperforming the broader energy sector, Diamondback has gained 27% this year, with average analyst expectations that it will add another 38% over the next 12 months. More than 7 out of 10 analysts rate the stock a buy. Marriott Vacations , known for its time share resorts, is down for the year but has rallied back 10% in the past three months as investors count on a continued resurgence in travel coming out of the pandemic. More than 8 out of every 10 (83%) analysts rate Marriott Vacations a buy. The average analyst expects the stock’s value to grow 48% in the next 12 months. It has lost about 20% year to date. Health care stock Lantheus Holdings also made the list. Every analyst covering it rates the stock a buy, according to FactSet, with an average price target showing an upside of 98%. The stock has gained 74% this year, building on a rally that kicked off in February on the back of a strong earnings report. The diagnostics maker said at the time that its earnings were helped by a new prostate imaging agent and growing sales of a product that enhances ultrasound imaging.