Error in eval(predvars, data, env) : object 'SEXC' not found

Thanks for providing code , but you could take further steps to make it more convenient for other forum users to help you.

Share some representative data that will enable your code to run and show the problematic behaviour.

You might use tools such as the library datapasta, or the base function dput() to share a portion of data in code form, i.e. that can be copied from forum and pasted to R session.

Reprex Guide

Aside from that, I think its worth a comment that use of $ syntax within an lm() construction is a bad code smell, and you are best advised to use the data = param to stipulate where the lm should look for the variables (as you do further down in your code).