Page 1 of 1

xtmixed syntax in runmlwin

Posted: Tue Apr 12, 2016 8:14 am
by oshabcde
I want to know how to replicate xtmixed command used by Roberto G. Gutierrez to smooth via penalized splines by using runmlwin command. Is it possible?

use http://www.stata.com/icpsr/mixed/motor, clear
local i 1
forvalues k = 1(1)60 {
gen time_‘i’ = cond(time - ‘k’ > 0, time - ‘k’, 0)
local ++i
}

xtmixed accel time || _all: time_*, noconstant cov(identity)

//The command that I have used is stated below.//

runmlwin accel times cons, level2(cons:bs*, elements(A) reset(all)) level1(id:cons) maxiterations(100) sd nopause

Re: xtmixed syntax in runmlwin

Posted: Tue Apr 12, 2016 9:30 am
by ChrisCharlton
The "motor" dataset that you reference seems to be no longer be available at that address, so I can't test this fully, but I think that the equivalent model would be something like:

Code: Select all

use http://www.stata.com/icpsr/mixed/motor, clear
local i 1
forvalues k = 1/60 {
  gen time_‘i’ = cond(time - ‘k’ > 0, time - ‘k’, 0)
  local ++i
}

local i 1
forvalues k = 2/60 {
  constraint define `i' [RP2]var(time_`k') = [RP2]var(time_1)
  local ++i
}

runmlwin accel time cons, level2(cons: time_*, diag) level1(id: cons) constraints(1/59) sd nopause