Skip to content

Commit

Permalink
Merge pull request #18 from harsharora21/main
Browse files Browse the repository at this point in the history
1. Print extra Info in `svyglm`
2. Keyword arguments to svyglm
  • Loading branch information
ayushpatnaikgit authored Jul 20, 2022
2 parents 8adaf6c + 55380c9 commit e8807d1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/svyglm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mutable struct svyglm
out
end

function svyglm(formula, design, dist, link)
function svyglm(formula, design, dist=Normal(), link=canonicallink(dist))
data = design.variables
rtol = 1e-8
atol = 1e-8
Expand All @@ -91,8 +91,16 @@ mutable struct svyglm
nullglm = glm(nullformula(formula), data, dist, link, wts = weights, rtol = rtol, atol = atol, maxiter = maxiter)
svyglm_cons(glmout, nullglm, data, weights, rtol, atol, maxiter)
end

svyglm(;formula, design, dist=Normal(), link=canonicallink(dist)) = svyglm(formula,design,dist,link)

end

function Base.show(io::IO, g::svyglm)
print(g.glm)
println("")
println("Degrees of Freedom: $(g.df_null) (i.e. Null); $(g.df_residual) Residual")
println("Null Deviance: $(g.null_deviance)")
println("Residual Deviance: $(g.deviance)")
println("AIC: $(g.aic)")
end

0 comments on commit e8807d1

Please sign in to comment.