Hi guys, I know what the error means but have no clue how to fix this. Im going quite mental at this point. So basically I want to run a simple regression.
Hi, the purpose of dataframes is to keep related data together, I would characterise your workflow as vector based. This is a direct cause of your difficulty as you are violating the relationships between variables by omitting na.s for some in a way that others are not affected....
Either deal with na.s upfront by omitting them from your dataframe as a whole. (Use na.omit)
Or learn to use tidyverse/dplyr style transformations which facilitate a dataframe level workflow.
First of all, thank you so much. Now it all has the same vector lengths however, i still can't run my regression is i receive a new error: Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'y'