Skip to content

Commit da630c7

Browse files
committed
revert to , use coef() methods instead
1 parent 55c6258 commit da630c7

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

R/kpgm_new.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,21 +275,21 @@ print.gmsar <- function(x, ...)
275275
summary.gmsar <- function(object, correlation = FALSE, Hausman=FALSE, ...)
276276
{
277277
object$coeftitle <- "(GM standard errors)"
278-
varnames <- names(object$coefficients)
279-
object$coefficients <- cbind(object$coefficients, object$rest.se,
278+
# varnames <- names(object$coefficients)
279+
object$Coef <- cbind(object$coefficients, object$rest.se,
280280
object$coefficients/object$rest.se,
281281
2*(1-pnorm(abs(object$coefficients/object$rest.se))))
282-
colnames(object$coefficients) <- c("Estimate", "Std. Error",
282+
colnames(object$Coef) <- c("Estimate", "Std. Error",
283283
"z value", "Pr(>|z|)")
284-
rownames(object$coefficients) <- varnames
284+
rownames(object$Coef) <- names(object$coefficients)
285285
if (Hausman && !is.null(object$Hcov)) {
286286
object$Haus <- Hausman.test(object)
287287
}
288288

289289
structure(object, class=c("summary.gmsar", class(object)))
290290
}
291291

292-
coef.summary.gmsar <- function(object, ...) object$coefficients
292+
coef.summary.gmsar <- function(object, ...) object$Coef
293293

294294

295295

@@ -318,14 +318,14 @@ print.summary.gmsar<-function (x, digits = max(5, .Options$digits - 3), signif.s
318318
"\n")
319319
}
320320
cat("Coefficients:", x$coeftitle, "\n")
321-
coefs <- x$coefficients
321+
coefs <- x$Coef
322322
if (!is.null(aliased <- x$aliased) && any(x$aliased)) {
323323
cat(" (", table(aliased)["TRUE"], " not defined because of singularities)\n",
324324
sep = "")
325325
cn <- names(aliased)
326326
coefs <- matrix(NA, length(aliased), 4, dimnames = list(cn,
327-
colnames(x$coefficients)))
328-
coefs[!aliased, ] <- x$coefficients
327+
colnames(x$Coef)))
328+
coefs[!aliased, ] <- x$Coef
329329
}
330330
printCoefmat(coefs, signif.stars = signif.stars, digits = digits,
331331
na.print = "NA")

R/s2sls.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ print.stsls <- function(x, ...) {
9494

9595
summary.stsls <- function(object, correlation = FALSE, ...) {
9696
rest.se <- sqrt(diag(object$var))
97-
varnames <- names(object$coefficients)
98-
object$coefficients <- cbind(object$coefficients, rest.se,
97+
# varnames <- names(object$coefficients)
98+
object$Coef <- cbind(object$coefficients, rest.se,
9999
object$coefficients/rest.se,
100100
2*(1-pnorm(abs(object$coefficients/rest.se))))
101-
if (object$robust) colnames(object$coefficients) <- c("Estimate",
101+
if (object$robust) colnames(object$Coef) <- c("Estimate",
102102
paste(object$HC, "std. Error"), "z value", "Pr(>|z|)")
103-
else colnames(object$coefficients) <- c("Estimate", "Std. Error",
103+
else colnames(object$Coef) <- c("Estimate", "Std. Error",
104104
"t value", "Pr(>|t|)")
105105

106-
rownames(object$coefficients) <- varnames
106+
rownames(object$Coef) <- names(object$coefficients)
107107
if (correlation) {
108108
object$correlation <- diag((diag(object$var))
109109
^(-1/2)) %*% object$var %*%
@@ -131,7 +131,7 @@ print.summary.stsls <- function(x, digits = max(5, .Options$digits - 3),
131131
zero.regs, "\n")
132132
}
133133
cat("\nCoefficients:", x$coeftitle, "\n")
134-
coefs <- x$coefficients
134+
coefs <- x$Coef
135135
printCoefmat(coefs, signif.stars=signif.stars, digits=digits,
136136
na.print="NA")
137137
correl <- x$correlation
@@ -165,7 +165,7 @@ residuals.stsls <- function(object, ...) {
165165

166166
coef.stsls <- function(object, ...) object$coefficients
167167

168-
coef.summary.stsls <- function(object, ...) object$coefficients
168+
coef.summary.stsls <- function(object, ...) object$Coef
169169

170170
deviance.stsls <- function(object, ...) object$sse
171171

R/sarlm_functions.R

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ summary.sarlm <- function(object, correlation = FALSE, Nagelkerke=FALSE,
8484
adj <- N/(N-(length(object$coefficients)))
8585
SE <- sqrt((SE^2) * adj)
8686
}
87-
varnames <- names(object$coefficients)
88-
object$coefficients <- cbind(object$coefficients, SE,
87+
# varnames <- names(object$coefficients)
88+
object$Coef <- cbind(object$coefficients, SE,
8989
object$coefficients/SE,
9090
2*(1-pnorm(abs(object$coefficients/SE))))
91-
colnames(object$coefficients) <- c("Estimate", "Std. Error",
91+
colnames(object$Coef) <- c("Estimate", "Std. Error",
9292
ifelse(adj.se, "t value", "z value"), "Pr(>|z|)")
93-
rownames(object$coefficients) <- varnames
93+
rownames(object$Coef) <- names(object$coefficients)
9494
} else {
9595
# intercept-only bug fix Larry Layne 20060404
9696
if (!is.null(object$rest.se)) {
@@ -101,17 +101,17 @@ summary.sarlm <- function(object, correlation = FALSE, Nagelkerke=FALSE,
101101
adj <- N/(N-(length(object$coefficients)))
102102
SE <- sqrt((SE^2) * adj)
103103
}
104-
varnames <- names(object$coefficients)
105-
object$coefficients <- cbind(object$coefficients, SE,
104+
# varnames <- names(object$coefficients)
105+
object$Coef <- cbind(object$coefficients, SE,
106106
object$coefficients/SE,
107107
2*(1-pnorm(abs(object$coefficients/SE))))
108-
colnames(object$coefficients) <- c("Estimate", "Std. Error",
108+
colnames(object$Coef) <- c("Estimate", "Std. Error",
109109
ifelse(adj.se, "t value", "z value"), "Pr(>|z|)")
110-
rownames(object$coefficients) <- varnames
110+
rownames(object$Coef) <- names(object$coefficients)
111111
}
112112
}
113113
# temporary fix for broom 210312
114-
object$Coef <- object$coefficients
114+
# object$Coef <- object$coefficients
115115
object$adj.se <- adj
116116

117117
if (Nagelkerke) {
@@ -149,14 +149,14 @@ print.summary.sarlm <- function(x, digits = max(5, .Options$digits - 3),
149149
}
150150
if (!is.null(x$coeftitle)) {
151151
cat("Coefficients:", x$coeftitle, "\n")
152-
coefs <- x$coefficients
152+
coefs <- x$Coef
153153
if (!is.null(aliased <- x$aliased) && any(x$aliased)){
154154
cat(" (", table(aliased)["TRUE"],
155155
" not defined because of singularities)\n", sep = "")
156156
cn <- names(aliased)
157157
coefs <- matrix(NA, length(aliased), 4, dimnames = list(cn,
158-
colnames(x$coefficients)))
159-
coefs[!aliased, ] <- x$coefficients
158+
colnames(x$Coef)))
159+
coefs[!aliased, ] <- x$Coef
160160
}
161161
printCoefmat(coefs, signif.stars=signif.stars, digits=digits,
162162
na.print="NA")
@@ -285,7 +285,7 @@ print.summary.sarlm <- function(x, digits = max(5, .Options$digits - 3),
285285
invisible(x)
286286
}
287287

288-
coef.summary.sarlm <- function(object, ...) object$coefficients
288+
coef.summary.sarlm <- function(object, ...) object$Coef
289289

290290
getVmate <- function(coefs, env, s2, trs, tol.solve=1.0e-10, optim=FALSE,
291291
optimM="optimHess") {

R/spautolm.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ coef.spautolm <- function(object, ...) {
268268
c(object$fit$coefficients, object$lambda)
269269
}
270270

271-
coef.summary.spautolm <- function(object, ...) object$coefficients
271+
coef.summary.spautolm <- function(object, ...) object$Coef
272272

273273
logLik.spautolm <- function(object, ...) {
274274
LL <- c(object$LL)
@@ -311,10 +311,10 @@ summary.spautolm <- function(object, correlation = FALSE, adj.se=FALSE,
311311
object$adj.se <- adj.se
312312

313313
object$rest.se <- sqrt(diag(object$resvar))
314-
object$coefficients <- cbind(object$fit$coefficients, object$rest.se,
314+
object$Coef <- cbind(object$fit$coefficients, object$rest.se,
315315
object$fit$coefficients/object$rest.se,
316316
2*(1-pnorm(abs(object$fit$coefficients/object$rest.se))))
317-
colnames(object$coefficients) <- c("Estimate", "Std. Error",
317+
colnames(object$Coef) <- c("Estimate", "Std. Error",
318318
ifelse(adj.se, "t value", "z value"), "Pr(>|z|)")
319319
if (Nagelkerke) {
320320
nk <- NK.sarlm(object)
@@ -327,7 +327,7 @@ summary.spautolm <- function(object, correlation = FALSE, adj.se=FALSE,
327327
dimnames(object$correlation) <- dimnames(object$resvar)
328328
}
329329
object$LR1 <- LR1.spautolm(object)
330-
rownames(object$coefficients) <- names(object$fit$coefficients)
330+
rownames(object$Coef) <- names(object$fit$coefficients)
331331
structure(object, class=c("summary.spautolm", class(object)))
332332
}
333333

@@ -353,14 +353,14 @@ print.summary.spautolm <- function(x, digits = max(5, .Options$digits - 3),
353353
zero.regs, "\n")
354354
}
355355
cat("\nCoefficients:", x$coeftitle, "\n")
356-
coefs <- x$coefficients
356+
coefs <- x$Coef
357357
if (!is.null(aliased <- x$aliased) && any(x$aliased)){
358358
cat(" (", table(aliased)["TRUE"],
359359
" not defined because of singularities)\n", sep = "")
360360
cn <- names(aliased)
361361
coefs <- matrix(NA, length(aliased), 4, dimnames = list(cn,
362-
colnames(x$coefficients)))
363-
coefs[!aliased, ] <- x$coefficients
362+
colnames(x$Coef)))
363+
coefs[!aliased, ] <- x$Coef
364364
}
365365
printCoefmat(coefs, signif.stars=signif.stars, digits=digits,
366366
na.print="NA")

0 commit comments

Comments
 (0)