R Under development (unstable) (2026-02-23 r89457 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 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. > ## predict.svyglm with rank-deficient model > ## from Terry Therneau, 6/24 > > load("sdata2.rda") > library(survival) > library(survey) Loading required package: grid Loading required package: Matrix Attaching package: 'survey' The following object is masked from 'package:graphics': dotchart > > pfit2 <- svyglm(pseudo ~ trt + flt3 + factor(time), design= sdata2) > pfit3 <- svyglm(pseudo ~ trt + flt3 + factor(time), design=sdata2, + family= gaussian(link= blog())) > pfit2b <- update(pfit2, . ~ . + flt3:time) > pfit3b <- update(pfit3, . ~ . + flt3:time) > dummy <- expand.grid(trt=c("A", "B"), flt3= LETTERS[1:3], time=24* 1:3) > > phat2b <- predict(pfit2b, newdata=dummy, type='response',se.fit=FALSE) > phat3b <- predict(pfit3b, newdata=dummy, type='response',se.fit=TRUE) > > stopifnot(class(phat2b)=="numeric") > stopifnot(class(phat3b)=="svystat") > > stopifnot(all.equal(as.vector(coef(phat3b))[1],12.3296615700191)) > stopifnot(all.equal(as.vector(phat2b)[1], 11.4568358310328)) > > proc.time() user system elapsed 1.15 0.10 1.25