[Gmm-commits] r199 - pkg/causalOTLSE/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 13 22:29:51 CEST 2022


Author: chaussep
Date: 2022-07-13 22:29:51 +0200 (Wed, 13 Jul 2022)
New Revision: 199

Modified:
   pkg/causalOTLSE/R/otlse.R
Log:
fixed some bugs

Modified: pkg/causalOTLSE/R/otlse.R
===================================================================
--- pkg/causalOTLSE/R/otlse.R	2022-07-13 19:11:05 UTC (rev 198)
+++ pkg/causalOTLSE/R/otlse.R	2022-07-13 20:29:51 UTC (rev 199)
@@ -55,7 +55,7 @@
     if (!is.list(knots))
     {
         if (length(knots) > 1)
-            warning("knots is either a list or a scalar. Only the first element is used")
+            warning("knots is either a list or a scalar. \nOnly the first element is used")
         knots <- lapply(1:ncol(X), function(i) knots[1])
     }
     isBinary <- apply(X, 2, function(x) all(x %in% c(1,0)))
@@ -132,7 +132,8 @@
     fit <- lm(formY, data)
     naCoef <- is.na(coef(fit))
     if (any(naCoef))       
-        warning(paste("The coefficients of the following variables are NA's:\n", paste(names(coef(fit)[naCoef]), collapse="\n"), "\n", sep=""))
+        warning(paste("\nThe coefficients of the following variables are NA's:\n",
+                      paste(names(coef(fit)[naCoef]), collapse=", "), "\n", sep=""))
     knots0 <- attr(data$Xf0, "knots")
     knots1 <- attr(data$Xf1, "knots")
     p0 <- attr(data$Xf0, "p")
@@ -384,7 +385,7 @@
     beta <- coef(lm.out)
     se.beta <- sqrt(diag(vcov))
     if (any(is.na(beta)))
-        warning(paste("The final regression is multicoliear. The result may not be valid:",
+        warning(paste("\nThe final regression is multicoliear. The result may not be valid:",
                       "\nThe following variables produced NA's\n",
                       paste(names(beta)[is.na(beta)], collapse=", ")), "\n", sep="")
     notNA0 <- !is.na(beta[idb0])



More information about the Gmm-commits mailing list