Hi everyone!
I have two variables (v_10_2_24 and v_10_2_24).
I need to make a correlation between those to but first i am asked to eliminate unwanted data from both of them before using "cor"
This is how it looks:
valoracionv<-subset(colmun,subset=v_10_2_24!=997&v_10_2_24!=998&v_10_2_24!=999)
The problem is that when I try to operate them or to correlate them there is a mistake which says that both variables have different lengths, so there is an error which says that the length of the variables is different so the cannot be correlated.
also, when i try to correlate them now, there is another mistake which says that my variable need to be changed to numeric but I really need it as a factor.
I already checked what you advised me and is already corrected. The issue now is that another error came up. R is reading my variables as atomic vector so when I need to operate them, and use the $ symbol, it says it is impossible: I checked online and I used the data frame alternative but the response when I print the variables is NULL, therefore, I can not effectuate a regression with them.
Do you know how cain I solve this issue?