This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ######################################################################## | |
| # Machine Learning using R Dimensionality Reduction by SOM # | |
| ######################################################################## | |
| ###### A Brief Overview of SOM (Self Organizing Maps) | |
| ### Self-organizing maps (SOMs) are unsupervised neural networks that | |
| ## project high-dimensional data onto a low-dimensional (usually | |
| ## 2D) grid while preserving neighborhood structure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################################################################# | |
| # Machine Learning using R How to Implement Multidimsional Scaling # | |
| ############################################################################################# | |
| #### Multidimensional Scaling (MDS) | |
| ## visualizes similarities/dissimilarities between objects | |
| ## by placing them in low-dimensional space (usually 2D/3D) | |
| ## where distances reflect original relationships | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################################################### | |
| # Machine Learning using R How to use the superSOM function # | |
| ############################################################################ | |
| ### In the R package kohonen, there is another function superSOM | |
| ### Features of superSOM | |
| ### Unified Multi-Layer Architecture: | |
| # Trains a single 2D grid where each node holds representative profiles | |
| # (codebooks) for multiple data layers, such as features and labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################################################################################# | |
| # Machine Learning using R Dimensionality Reduction by using UMAP # | |
| ################################################################################# | |
| ############## Brief Overview of UMAP (Uniform Manifold Approximation and Projection | |
| ### UMAP excels as a dimensionality reduction technique by preserving | |
| ## both local neighborhood structure and global data topology simultaneously. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################################################################### | |
| # Machine Learning using R Regression and Classification using Shallow Neural Networks # | |
| ########################################################################################### | |
| # Load necessary libraries | |
| library(nnet) # For shallow neural networks | |
| library(neuralnet) # For visualizing and custom training | |
| library(caret) # For data splitting and evaluation | |
| install.packages("NeuralNetTools") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### Causal Analysis using R G Estimation by the R package CausalModels | |
| # Install and load CausalModels package if not installed | |
| if (!requireNamespace("CausalModels", quietly = TRUE)) { | |
| install.packages("CausalModels") | |
| } | |
| library(CausalModels) | |
| library(causaldata) | |
| data(nhefs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### Causal Analysis using R G Estimation using GEE | |
| ## James Robins' G estimation is one of the g methods, a class of causal inference techniques | |
| ## including the g formula and marginal structural models, designed for complex longitudinal | |
| ## studies with time-varying confounders. | |
| #### It specifically focuses on structural nested models and uses the conditional independence | |
| ## between treatment and potential outcomes to consistently estimate causal effects | |
| ## under weaker assumptions than standard regression. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This R script is a step by step tutorial on how to implement the DO Calculus developed by Judea Pearl. The R packages used include: causaleffect, mediation, igraph and dplyr. We demonstrate how to create a simulated data set, how to define a DAG, how to estimate the expression identified by the DO Calculus and how to use that expression to calculate average causal effect (ACE). Furthermore, we showed how to perform causal mediational analysis and how to interpret its outputs. | |
| A step by step video demonstration can be found at: https://youtu.be/yNzpoWRgZdE?si=MJIpRcp74uqfqhjc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### How to Perform a Path Analysis using R | |
| # Path analysis is an extension of regression that models both direct and indirect relationships | |
| # among a set of observed variables within a system of structured equations. | |
| # It allows variables to act as both predictors and outcomes, thus examining complex causal chains, | |
| # not just single dependencies. | |
| # The method breaks down effects into direct effects (immediate influence) and indirect effects | |
| # (mediated through other variables), clarifying how causal influence travels through the network. | |
| # Path analysis is commonly visualized using a path diagram, where arrows represent hypothesized | |
| # causal connections, and it serves as a subset of structural equation modeling with only observed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## How to Perform a Propensity Score Matching Analysis using R | |
| #The propensity score is the probability that an individual receives a treatment given | |
| # their #observed characteristics. | |
| #It is used in observational studies to create a balance between treated and untreated | |
| # groups, aiming to mimic the conditions of a randomized controlled trial. | |
| #By matching or comparing individuals with similar propensity scores, researchers can | |
| # reduce bias due to confounding factors. | |
| #Propensity scores are commonly estimated using logistic regression models based on #baseline covariates. | |
| # Methods using propensity scores include matching, stratification, weighting, and |
NewerOlder