Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cran/KRLS
12 September 2020, 19:32:35 UTC
  • Code
  • Branches (20)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.1
    • refs/tags/0.2
    • refs/tags/0.3-1
    • refs/tags/0.3-2
    • refs/tags/0.3-5
    • refs/tags/0.3-7
    • refs/tags/1.0-0
    • refs/tags/R-2.13.2
    • refs/tags/R-2.14.0
    • refs/tags/R-2.14.1
    • refs/tags/R-2.14.2
    • refs/tags/R-2.15.0
    • refs/tags/R-2.15.1
    • refs/tags/R-2.15.2
    • refs/tags/R-2.15.3
    • refs/tags/R-3.0.0
    • refs/tags/R-3.0.1
    • refs/tags/R-3.0.2
    • refs/tags/R-3.0.3
    No releases to show
  • 9597e8e
  • /
  • R
  • /
  • summary.krls.R
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:a32bce8e3c0b269b59395c04fb812bdf4c5aa598
origin badgedirectory badge
swh:1:dir:55c1b74116f8d6532a44cca24fa65bde5ffcd11c
origin badgerevision badge
swh:1:rev:9ee4980f0f951956294c84b7f49fe4374e5a432b
origin badgesnapshot badge
swh:1:snp:dd0ef9cc93a5e7a49e321b9136db9970052e4411

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 9ee4980f0f951956294c84b7f49fe4374e5a432b authored by Jens Hainmueller on 10 July 2017, 12:55:59 UTC
version 1.0-0
Tip revision: 9ee4980
summary.krls.R
summary.krls <-
function(object, probs=c(.25,.5,.75),...)
      {
            
        if( class(object)!= "krls" ){
        warning("Object not of class 'krls'")
        UseMethod("summary")
        return(invisible(NULL))
        }
        
        cat("* *********************** *\n")
        cat("Model Summary:\n\n")
        cat("R2:",object$R2,"\n\n")
        
        d <- ncol(object$X)
        n <- nrow(object$X)
        
        coefficients <- matrix(NA,d,0)
        rownames(coefficients) <- colnames(object$X) 
                
       
        if(is.null(object$derivatives)){
          cat("\n")
          cat("recompute krls object with krls(...,derivative = TRUE) to get summary of marginal effects\n")
          return(invisible(NULL))
        } 
        
        # average marginal effects  
        est     <- t(object$avgderivatives)
        se     <- sqrt(t(object$var.avgderivatives))
        tval   <- est/se
        avgcoefficients <- cbind(est, se, tval, 2 * pt(abs(tval),n-d, lower.tail = FALSE))
        colnames(avgcoefficients) <- c("Est", "Std. Error", "t value", "Pr(>|t|)")
        
       # add stars for binary    
        if(sum(object$binaryindicator)>0){         
          rownames(avgcoefficients)[object$binaryindicator] <- paste(rownames(avgcoefficients)[object$binaryindicator],"*",sep="")
        }
        
        cat("Average Marginal Effects:\n")
        print(avgcoefficients,...)
        if(sum(object$binaryindicator)>0){
        cat("\n(*) average dy/dx is for discrete change of dummy variable from min to max (i.e. usually 0 to 1))\n\n")
        }
        
        # quantiles of derivatives
        qderiv <- apply(object$derivatives,2,quantile,probs=probs)
        if(sum(object$binaryindicator)>0){         
          colnames(qderiv)[object$binaryindicator] <- paste(colnames(qderiv)[object$binaryindicator],"*",sep="")
        }
        qderiv <- t(qderiv)
        
        cat("\n")
        cat("Quartiles of Marginal Effects:\n")
        print(qderiv,...)
        
        if(sum(object$binaryindicator)>0){
         cat("\n(*) quantiles of dy/dx is for discrete change of dummy variable from min to max (i.e. usually 0 to 1))\n\n")
        }
                     
      ans <- list(
                 coefficients=avgcoefficients,
                 qcoefficients=qderiv)
      class(ans) <- "summary.krls"  
      return(invisible(ans))
}

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API