R Under development (unstable) (2023-12-13 r85679 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > library(aster) > > data(radish) > > pred <- c(0,1,2) > fam <- c(1,3,2) > > ### need object of type aster to supply to penmlogl and pickle > > aout <- aster(resp ~ varb + fit : (Site * Region + Block + Pop), + pred, fam, varb, id, root, data = radish) > > ### model matrices for fixed and random effects > > modmat.fix <- model.matrix(resp ~ varb + fit : (Site * Region), + data = radish) > modmat.blk <- model.matrix(resp ~ 0 + fit:Block, data = radish) > modmat.pop <- model.matrix(resp ~ 0 + fit:Pop, data = radish) > > rownames(modmat.fix) <- NULL > rownames(modmat.blk) <- NULL > rownames(modmat.pop) <- NULL > > idrop <- match(aout$dropped, colnames(modmat.fix)) > idrop <- idrop[! is.na(idrop)] > modmat.fix <- modmat.fix[ , - idrop] > > nfix <- ncol(modmat.fix) > nblk <- ncol(modmat.blk) > npop <- ncol(modmat.pop) > > ### try newpickle > > sigma.start <- c(1, 1) > alpha.start <- aout$coefficients[match(colnames(modmat.fix), + names(aout$coefficients))] > cee.start <- rep(0, nblk + npop) > alphaceesigma.start <- c(alpha.start, cee.start, sigma.start) > > foo <- newpickle(alphaceesigma.start, fixed = modmat.fix, + random = list(modmat.blk, modmat.pop), obj = aout) > names(foo) [1] "value" > > > proc.time() user system elapsed 0.31 0.09 0.34