rStats.js v1.3.0
    Preparing search index...

    Function coefci

    • Confidence intervals of the coefficients of an lm or glm fit with a given covariance matrix. Equivalent to R's lmtest::coefci().

      The limits estimate ± q se with the t quantile on df degrees of freedom, or the normal quantile (by default for a glm of every family, as lmtest). parm takes 0-based indices (R: 1-based) or names. The standard errors as in coeftest: from the covariance in units of powers of 2 for a result of vcovHC or vcovCL or its original matrix, not for a copy of the matrix (which gives intervals of width 0 where it holds 0).

      Parameters

      Returns CoefciResult

      const fit = lm([1, 2, 3, 4, 5, 6], [1.1, 2.3, 2.8, 4.5, 4.9, 6.4]);
      const ci = coefci(fit, { vcov: (f) => vcovHC(f) });
      ci.colNames; // ["2.5 %", "97.5 %"]
      ci.lower; // [-0.51418, 0.84206]