
Recent Posts
Archives
Categories
Meta
Advertisements
#For use when comparing the fit of nested models with complex data, # (e.g. TYPE = COMPLEX is mplus) # The Scaled Difference Chisquare Test Statistic can be found at #http://preprints.stat.ucla.edu/260/chisquare.pdf # This function provides scaled differences tests based on … Continue reading
library (MASS) covar<mvrnorm(250, c(0, 0), matrix(c(1, 0.00, 0.00, 1), 2, 2)) mydata<data.frame(covar) names(mydata)<c("sat", "mot") mydata$admin< mydata$sat + mydata$mot mydata$admin2< ifelse (mydata$admin >=quantile(mydata$admin, .85), "pass", "fail") library(ggplot2) qplot(sat,mot, data = mydata, color = admin2) Created by Pretty R at insideR.org
I am sure it is out there but for my record keeping purposes and for anyone interested here is a quick function to find Stirling’s approximation of all possible permutations Stirling< function (n)((2*pi*n)^.5)*(n/exp(1))^n Created by Pretty R at insideR.org
R does not give a Pseudo R square value and neither does Mplus. As such, here is a real quick R function to calculate McFadden’s and Adjusted McFadden’s Pseudo R square value: #Pesudo R square #x = full model … Continue reading
I have reworked the graphing and summarizing functions I wrote for the matchit package to be cleaner and to provide more information. Currently I have functions for a sorted by size summary table of the post matching mean differences: meandifftable< … Continue reading
Have been attending a seminar on propensity score matching this week, when I was asked if I could write a function to reduce the complexity of the matchit package output. I produced two functions. First I wrote a function to … Continue reading
I am a fan of Kmeans approaches to clustering data particularly when you have a theoretical reason to expect a certain number of clusters and you have a large data set. However, I think ploting the cluster means can be … Continue reading