Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pfr(): multiple fpc-terms don't work #62

Open
fabian-s opened this issue Apr 12, 2016 · 0 comments
Open

pfr(): multiple fpc-terms don't work #62

fabian-s opened this issue Apr 12, 2016 · 0 comments
Assignees

Comments

@fabian-s
Copy link
Member

pfr(pasat ~ fpc(cca), data=DTI[complete.cases(DTI),])
pfr(pasat ~ fpc(rcst), data=DTI[complete.cases(DTI),])
# so far so good

pfr(pasat ~ fpc(rcst) + fpc(cca), data=DTI[complete.cases(DTI),])
# Error in xt$X %*% sm$X : non-conformable arguments
## xt$X is 229 x 55 (55 is the gridlength for rcst)
## sm$X is 93 x 40 (93 is the gridlength for cca)

pfr(pasat ~ fpc(cca) + fpc(rcst), data=DTI[complete.cases(DTI),])
# Error in xt$X %*% sm$X : non-conformable arguments
## xt$X is 229 x 93 (gridlength for cca)
## sm$X is 55 x 40 (55 is the gridlength for rcst)

seems like the order of the terms matters here and that either xt$X or sm$X use the wrong functional covariate....

(tested with refundDevel @ ce08fcb)

@jgellar :
I suspect this

if ("xt" %in% names(x$call)) {
        xtvars <- all.vars(x$call$xt)
        if (length(xtvars)) {
          sapply(xtvars, function(xtvar) {
            xtvarval <- eval(as.name(xtvar), envir = evalenv, enclos = frmlenv)
            #assign into parent of newfrmlenv because these are not
            #necessarily covariates so list2df(newfrmlenv) below would fail
            assign(x = xtvar, value = xtvarval, envir = parent.env(newfrmlenv))
            invisible(NULL)
          })
        }
      }

may be the section of pfr where this goes wrong, but I'm not sure. Hope it's ok to assign this to you...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants