R squared for categorical
I have a question regarding the factors that R depends on, the type of data, So I remember saying that it must be two numerical variables So how can we calculate the R for categorical data?
If you convert categorical data (for example, Yes or No) into a number (1 or 0, respectively), you would theoretically be able to calculate an R-squared. However, the result would not be reliable as it would miss the properties or characteristics of an R-squared calculated from "genuinely" numerical data.
Therefore, I would strongly recommend NOT to calculate the R-squared for categorical data.