Skip to content

Instantly share code, notes, and snippets.

View csetzkorn's full-sized avatar
🎯
Focusing

Chris Setzkorn csetzkorn

🎯
Focusing
View GitHub Profile
@alexgleith
alexgleith / SimpleLoadS2.ipynb
Last active April 10, 2024 18:38
Simplest example for finding and loading Sentinel-2 data using Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adrianolszewski
adrianolszewski / logistic_regression_testing_hypotheses.md
Last active February 18, 2024 23:38
Logistic regression is often used for testing hypotheses, replacing a variety of common classic tests

Despite the widespread and nonsensical claim, that "logistic regression is not a regression", it constitutes one of the key regression and hypothesis testing tools used in the experimental research (like clinical trials).

Let me show you how the logistic regression (with a few extensions) can be used to test hypotheses about fractions (%) of successes, repacling the classic "test for proportions". Namely, it can replicate the results of:

  1. the Wald's (normal approximation) z test for 2 proportions with non-pooled standard errors (common in clinical trials) via LS-means on the prediction scale or AME (average marginal effect)
  2. the Rao's score (normal appr.) z test for 2 proportions with pooled standard errors (just what the prop.test() does in R)
  3. the z test for multiple (2+) proportions
  4. ANOVA-like (joint) test for multiple caterogical predictors (n-way ANOVA). Also (n-way) ANCOVA if you employ numerical covariates.
  5. [the **Cochran-Mantel-Haenszel
@MartGro
MartGro / Chatterjees_Xi.ipynb
Created December 26, 2021 19:55
Quick demonstration of a new coefficient of correlation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@snakers4
snakers4 / abstractions.py
Last active May 27, 2022 07:12
My XGB boilerplate
# https://www.analyticsvidhya.com/blog/2016/03/complete-guide-parameter-tuning-xgboost-with-codes-python/
#Import libraries:
import pandas as pd
import numpy as np
import xgboost as xgb
from xgboost.sklearn import XGBClassifier
from sklearn import cross_validation, metrics #Additional scklearn functions
from sklearn.grid_search import GridSearchCV #Perforing grid search
import matplotlib.pylab as plt
@grofit
grofit / Account.cs
Created January 7, 2015 11:45
A GOOD Generic Repository Pattern
public class Account
{
Guid Id {get;set;}
string Name {get;set;}
}
@dbetebenner
dbetebenner / Quantile_Regresion_with_B_Splines.R
Created August 1, 2013 08:53
Quantile regression with b-splines using R
require(splines)
require(quantreg)
### Create some data
x <- rnorm(100, mean=50, sd=10)
noise <- rnorm(100, sd=5)
y <- x + noise