Git Product home page Git Product logo

glsmr's Introduction

glsmr

GAM and linear stratified MR

This is an R package to aid in determining if observational or two-stage least square (instrument variable or in genetics Mendelian randomization) analysis have a non-linear relationship between expoosure and outcome.

installation

devtools::install_github("hughesevoanth/glsmr")

use

  • There are two functions that are most useful

    • glsmr()
    • plot_glsmr()
  • an example for using glsmr

      myexample = glsmr( wdata = mydata,
            outcome = "trait",
            exposure = "bmi",
            instrument = "bmi_grs",
            linear_covariates = c("batch", "sex"),
            smooth_covariates =  c("age"),
            # strata = 4, ## for quartiles
            strata = c(10,18.5,25,30,45),
            rnt_outcome = TRUE,
            weights_variable = NA,
            outlier_method = "iqr",
            outlier_cutoff = 5,
            messages = FALSE,
            return_models = TRUE)
    
    • NOTE: 'smooth_covariates' will be modeled as smooths or non-linear variables in the GAM, but as typical parametric variables in the linear and tsls analyses.
  • an example for using plot_glsmr()

      plot_glsmr(myexample,
      	add_strata_2_curves = FALSE,
      	add_strata_2_points = TRUE,
      	brewer_col = "Set1",
      	old_plot_scheme = TRUE,
      	old_GAM_smooths = TRUE,
      	plot_obs_res_betas = FALSE,
        	pval_thresh = 0.05)
    

An example figure from plot_glsmr()

See this repo's wiki for more information

wiki page here

glsmr's People

Contributors

hughesevoanth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.