Hola buenas noches,

tengo un problema bastante gordo. ¿A alguno le ha dejado de funcionar las
funciones pamer.fnc y mcp.fnc con la nueva versión de R? La semana pasada
formatee el ordenador y ahora scripts antiguos no funcionan. La cuestión es
que me precupa que no funcione el ejemplo de tutorial del autor.

Os dejo un script que debería de funcionar y no lo hace
#----------------------------------------------------------------------------------------------------------------------------------
dat <- data.frame(row.names= 1:20)
dat$Subject <-
  factor(rep(x= c("S1","S2","S3","S4"), each= 5))
dat$RT <- rnorm( 20, mean= 500,sd= 20)
dat$Condicion1 <-
  factor(rep(x= c("A","B"), each= 2))
dat$Condicion2 <-
  factor(rep(x= c("X","Y")))

mod <- lmer( RT ~  Condicion1 * Condicion2 + (1|Subject), data=dat)
summary(mod)

pamer.fnc(mod)

#Error en qr(model@X) :
#  error in evaluating the argument 'x' in selecting a method for
#function 'qr': Error: no hay un slot de nombre "X" para ese objeto
#de clase "lmerMod"

#----------------------------------------------------------------------------------------------------------------------------------

También os dejo un ejemplo de la ayuda del paquete. ¿Alguna idea de como
solucionar esto?
¿volver a una versión anterior? ¿Contactar con el autor?


Si alguien me ayuda le estaré tremendamente agradecido llevo meses haciendo
analisis con estas técnicas y que ahora no funcionen puende ser un problema
para futuras investigaciones.

Gracias por adelantado y un cordial saludo

Javier


#----------------------------------------------------------------------------------------------------------------------------------
Teneis que instalar los paquete:

LCFdata

LMERConvenienceFunctions

lme4


http://cran.r-project.org/web/packages/LMERConvenienceFunctions/LMERConvenienceFunctions.pdf


if(try(require(LCFdata,quietly=TRUE))){
  ### Load and format data
  require(LCFdata)
  data(eeg)
  # restrict to electrode Fz and 80--180 ms window
  eeg <- eeg[eeg$Time >= 80 & eeg$Time <= 180, ]
  eeg <- eeg[, c("Subject", "Item", "Time", "Fz",
                 "FreqB", "LengthB", "WMC")]
  # mean center FreqB
  eeg$FreqBc <- eeg$FreqB - mean(eeg$FreqB)
  # split FreqBc into 3 categories. Doesn’t make sense,
  # but it’s merely for example
  eeg$FreqBdc <- "high"
  eeg$FreqBdc[eeg$FreqBc<=quantile(eeg$FreqBc)[3]] <- "mid"
  eeg$FreqBdc[eeg$FreqBc<=quantile(eeg$FreqBc)[2]] <- "low"
  eeg$FreqBdc <- as.factor(eeg$FreqBdc)
  eeg$FreqBdc <- relevel(eeg$FreqBdc, "low")
  # mean center LengthB
  eeg$LengthBc <- eeg$LengthB - mean(eeg$LengthB)
  # mean center WMC
  eeg$WMCc <- eeg$WMC - mean(eeg$WMC)
  ### demonstrate plotDensity3d,fnc
  plotDensity3d.fnc(x = sort(unique(eeg$WMCc)),
                    y = sort(unique(eeg$LengthBc)))
  ### demonstrate plotDensity3d,fnc
  plotRaw3d.fnc(data = eeg, response = "Fz", pred = "WMCc",
                intr = "LengthBc", plot.type = "persp", theta = 150)
  ### Analyze data
  # fit initial model
  m0 <- lmer(Fz ~ (FreqBdc + LengthBc + WMCc)^2 + (1 | Subject),
             data = eeg)
  m1 <- lmer(Fz ~ (FreqBdc + LengthBc + WMCc)^2 + (1 | Subject) +
               (1 | Item), data = eeg)
  # which model to choose?
  relLik(m0, m1)
  # choose m1
  # check model assumptions
  mcp.fnc(m1)
  # remove outliers
  eeg <- romr.fnc(m1, eeg, trim = 2.5)
  eeg$n.removed
  eeg$percent.removed
  eeg<-eeg$data
  # update model
  m1 <- lmer(Fz ~ (FreqBdc + LengthBc + WMCc)^2 + (1 | Subject) +
               (1 | Item), data = eeg)
  # re-check model assumptions
  mcp.fnc(m1)
  # forward-fit random effect structure (simple for the purposes
  # of the example).
  m2 <- ffRanefLMER.fnc(model = m1, data = eeg, ran.effects =
                          c("(0 + LengthBc | Subject)", "(0 + WMCc | Item)"),
                        log.file = FALSE)
  # backfit model m2. In this case, could use bfFixefLMER_t.fnc instead.
  m3 <- bfFixefLMER_F.fnc(m2, log.file = FALSE)
  # The calls to ffRanefLMER.fnc and bfFixefLMER_F.fnc could
  # be replaced by a call to fitLMER.fnc. In this latter case, however,
  # bfFixefLMER_F.fnc would be called first, then the random effect
  # structure would be forward fitted, and finally teh fixed effects
  # would be backfitted again.
  m3b <- fitLMER.fnc(model = m1, ran.effects = c("(0 + LengthBc | Subject)",
                                                 "(0 + WMCc | Item)"),
backfit.on = "F", log.file = FALSE)
  pamer.fnc(m3b)
  # The results are the same. This may not necessarily be the case
  # elsewhere. First forward fitting the random effect structure and
  # then backfitting the fixed effects, potentially pruning irrelevant
  # random effects, is probably the best approach. Nonetheless, there is
  # no hard evidence to this effect.
  # check model assumptions
  mcp.fnc(m3)
  # check significance of model terms
  pamer.fnc(m3)
  # Only the intercept is significant. For purposes of the
  # example, let’s perform a posthoc analysis on FreqBdc on
  # model m2.
  m2.ph <-
    mcposthoc.fnc(model = m2, var = list(ph1 = "FreqBdc"))
  if(try(require(languageR,quietly=TRUE))){
    # Generate plot for Length X Freq with function plotLMER.fnc
    require(languageR)
    plotLMER.fnc(m2, pred = "LengthBc", intr = list("FreqBdc",

levels(eeg$FreqBdc), "beg", list(1 : 3, 1 : 3)))
  }
  # effect of Length at each FreqB bin
  summary(object = m2.ph, term = "LengthBc")
  # Length effect different Freq bins? Start with low
  # versus mid and high
  smry <- summary(object = m2.ph, term = "FreqBdclow:LengthBc")
  # mid versus low and high
  smry <- summary(object = m2.ph, term = "FreqBdcmid:LengthBc")
}
## End(Not run)

#----------------------------------------------------------------------------------------------------------------------------------

--

	[[alternative HTML version deleted]]

