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

I tried to run standardization and ran into this. Where or what did I miss? Can anyone help? I am able to load bmi_stand at the beginning though

The object has to be reachable by the function. In the lm() call at the top, bmi_stand is referred to and data is given as the source. So, if bmi_stand isn't there, you would get this message.

Hi technocrat,

I imported the data "antihypertensive.csv" at the very beginning of the Rmd. And bmi_stand is one of the variables in it

And there after I ran a multivariate regression with interactions and bmi_stand still okay

It is when I ran this standardization that bmi_stand pop up as an error. I tried to re-load the dataset=data and I still have the error

In the dataset "data", bmi_stand is a variable though

The relevant data is the newdata param for which theres a data.frame() you wrote , which misses out the expected variable. You probably should write bmi_stand in place of standardized_bmi

Thank you it works!!!!