Skip to content

Commit 1c944c5

Browse files
committed
fix(glm): get family name from object (legacy dsBase) or from returned character
1 parent f131520 commit 1c944c5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

R/ds.glm.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,8 @@ ds.glm <- function(formula=NULL, data=NULL, family=NULL, offset=NULL, weights=NU
565565
# Sum participants only during first iteration.
566566
nsubs.total<-Reduce(f="+", .select(study.summary, 'numsubs'))
567567
# Save family
568-
f <- study.summary[[1]]$family
568+
family.value <- study.summary[[1]]$family
569+
f <- if (is.list(family.value) && "family" %in% names(family.value)) family.value$family else family.value
569570
}
570571

571572
#Create variance covariance matrix as inverse of information matrix
@@ -640,7 +641,7 @@ ds.glm <- function(formula=NULL, data=NULL, family=NULL, offset=NULL, weights=NU
640641
beta.vect.final<-beta.vect.next
641642

642643
scale.par <- 1
643-
if(f$family== 'gaussian') {
644+
if(f == 'gaussian') {
644645
scale.par <- dev.total / (nsubs.total-length(beta.vect.next))
645646
}
646647

0 commit comments

Comments
 (0)