From 1b9d0bccb2b636bfe2af8baf3222d3c4aacd0cb4 Mon Sep 17 00:00:00 2001 From: harsharora21 Date: Mon, 18 Jul 2022 13:52:58 +0530 Subject: [PATCH 1/4] added keyword args for svyglm --- src/svyglm.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/svyglm.jl b/src/svyglm.jl index 4580fb7d..4f426631 100644 --- a/src/svyglm.jl +++ b/src/svyglm.jl @@ -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 @@ -91,6 +91,10 @@ 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,link) = svyglm(formula,design,dist,link) + svyglm(;formula,design,dist,link) = svyglm(formula,design,dist,link) + end function Base.show(io::IO, g::svyglm) From e1e98608072b60320e2aca403c0222fab30a0af5 Mon Sep 17 00:00:00 2001 From: harsharora21 Date: Mon, 18 Jul 2022 14:08:45 +0530 Subject: [PATCH 2/4] fixed keyword args for svyglm --- src/svyglm.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/svyglm.jl b/src/svyglm.jl index 54bf577b..7878ab6f 100644 --- a/src/svyglm.jl +++ b/src/svyglm.jl @@ -92,8 +92,8 @@ mutable struct svyglm svyglm_cons(glmout, nullglm, data, weights, rtol, atol, maxiter) end - svyglm(formula;design,dist,link) = svyglm(formula,design,dist,link) - svyglm(;formula,design,dist,link) = svyglm(formula,design,dist,link) + svyglm(formula; design, dist=Normal(), link=canonicallink(dist)) = svyglm(formula,design,dist,link) + svyglm(;formula, design, dist=Normal(), link=canonicallink(dist)) = svyglm(formula,design,dist,link) end From 8c6fc558243fa293c98e6f8aa5cb06972d421724 Mon Sep 17 00:00:00 2001 From: harsharora21 Date: Mon, 18 Jul 2022 14:43:15 +0530 Subject: [PATCH 3/4] print extra info svyglm base.show --- src/svyglm.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/svyglm.jl b/src/svyglm.jl index 7878ab6f..30ee8fa9 100644 --- a/src/svyglm.jl +++ b/src/svyglm.jl @@ -99,4 +99,9 @@ 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 From 55380c98db11c70405afa666b0dceaf19819da72 Mon Sep 17 00:00:00 2001 From: harsharora21 Date: Mon, 18 Jul 2022 15:24:15 +0530 Subject: [PATCH 4/4] changed svyglm keywords --- src/svyglm.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/svyglm.jl b/src/svyglm.jl index 30ee8fa9..166ab704 100644 --- a/src/svyglm.jl +++ b/src/svyglm.jl @@ -92,9 +92,8 @@ mutable struct svyglm svyglm_cons(glmout, nullglm, data, weights, rtol, atol, maxiter) end - svyglm(formula; design, dist=Normal(), link=canonicallink(dist)) = svyglm(formula,design,dist,link) svyglm(;formula, design, dist=Normal(), link=canonicallink(dist)) = svyglm(formula,design,dist,link) - + end function Base.show(io::IO, g::svyglm)