Dear Statalisters,
Do fvexpand and fvrevar order their output identically when applied to the same varlist?
I am currently working on a code that uses the output of fvexpand to refer to output obtained with variables that fvrevar generates. This procedure relies on the assumption that both fvexpand and fvrevar order factor variables identical in their respective output. The minimum working example below illustrates what I am trying to achieve.
Are there any references that the two commands order their output identically or any experiences that this is (not) the case? (As the two commands are built-in, it is not possible for me to check the code.)
Many thanks in advance!
Michael
clear all
set obs 10
set seed 1
gen cont = runiform()
gen binary = (runiform() > .5)
local varlist c.cont##i.binary // define varlist for both commands
fvexpand `varlist'
local reference "`r(varlist)'"
fvrevar `varlist'
local variables "`r(varlist)'"
disp "The following summary statistics refer to the expressions: `reference'" // if `reference’ and `variables’ have the same ordering
sum `variables'
Do fvexpand and fvrevar order their output identically when applied to the same varlist?
I am currently working on a code that uses the output of fvexpand to refer to output obtained with variables that fvrevar generates. This procedure relies on the assumption that both fvexpand and fvrevar order factor variables identical in their respective output. The minimum working example below illustrates what I am trying to achieve.
Are there any references that the two commands order their output identically or any experiences that this is (not) the case? (As the two commands are built-in, it is not possible for me to check the code.)
Many thanks in advance!
Michael
clear all
set obs 10
set seed 1
gen cont = runiform()
gen binary = (runiform() > .5)
local varlist c.cont##i.binary // define varlist for both commands
fvexpand `varlist'
local reference "`r(varlist)'"
fvrevar `varlist'
local variables "`r(varlist)'"
disp "The following summary statistics refer to the expressions: `reference'" // if `reference’ and `variables’ have the same ordering
sum `variables'
Comment