I have a set of variables X1, X2, X3, X4, X5. Among them, X5 is colinear with X3. So I use the command "_rmcoll" to delete X5 from my variable list. And the following is the code and the result.


Code:
_rmcoll x1 x2 x3 x4 x5
note: x5 omitted because of collinearity

local variables `r(varlist)'

display "`variables'"
x1 x2 x3 x4 o.x5
The problem is, the variable x5 is not really deleted. It is still there marked as a factorial variable "o.x5".

Since I need to create a matrix for the remaining variable list using the command "mkmat", which does not allow factorial variables, I need to get rid of the "o.x5" in the variable list.


Code:
_rmcoll x1 x2 x3 x4 x5

note: x5 omitted because of collinearity

local variables `r(varlist)'

display "`variables'"
x1 x2 x3 x4 o.x5

mkmat`variables', matrix(variables)
factor-variable and time-series operators not allowed
r(101);

Is there any way I can exclude the annoying factorial "o.x5" from my macro "`variables'"? I cannot do it manually since part of a Stata package.