Dirk Enzmann - Statistical Software (Some Useful Things)

Below you find some small executables, SPSS macros, EXCEL-templates, R functions (see: http://www.r-project.org/) and Stata ado-files I wrote for special calculations in statistical analyses. The executable programs are written in Pascal 7.0 and run under Windows (3.x, 9x, NT4, XP). The files can be downloaded and spread without further permisson under the condition that they remain unchanged. They have been tested as virus free. The author is not liable to any damages caused by their use. Comments on improvements are welcome.

  BetaDiff:
Executable program for calculating confidence intervals and testing the significance of the difference of two beta-coefficients from independent samples
BetaDiff.zip ( description ) ( download )

  Center:
SPSS macro for centering a set of variables (with listwise deletion of missing cases); useful for computing products of variables for interaction terms in regression analyses.
Center.sps ( download )

  CorrTot:
Executable program and R function for computing pooled means, standard deviations and a pooled correlation matrix from means, standard deviations and correlation matrices of two independent samples
CorrTot.zip ( description ) ( download ) corrtot.r (R-function)

  CovMat:
SPSS macro for writing a covariance matrix of a set of variables (with listwise deletion of missing cases) to a text file
CovMat.sps ( download )

  Crosstabs:
R function to simulate the SPSS procedure CROSSTABS.
crosstabs.r ( download )

  DumCode:
SPSS macro for creating dummy variables (indicator coding) of a nominal variable. Useful for regression analyses with independent variables that are categorical.
DumCode.sps ( download )

  Fa.promax:
R function to compute maximum likelihood factor analysis with varimax and promax rotation; allows specification of promax power and sorting of loadings; output  includes correlation matrix of factors and (optionally) matrices of factor scores
fa.promax ( download )

  Freq:
R function to simulate the SPSS procedure FREQUENCIES.
freq.r ( download )

  Hist.KDNC:
R function to plot a histogram overlayed by a kernel density and a normal curve.
hist.kdnc.r ( download )

  IntGraph:
Excel-template for drawing interaction plots of a regression equation with interaction term.
IntGraph.xlt ( description ) ( download )

  Kurtosis:
R function to compute the unbiased population estimate or biased sample statistic of kurtosis.
kurtosis.r ( download )

  LogRegR2:
R function to calculate ChiČ model fit and RČ analogs (pseudo RČ: McFadden's RČ, Cox & Snell index, Nagelkerke index) of a logistic regression model obtained by glm(..., family = 'binomial').
LogRegR2.r ( download )

  MeanSD:
Executable program or computing interactively the mean and standard deviation of a combined sample from up to 50 independent samples.
MeanSD.zip ( download )

  MeanSDF:
Same as MeanSD for up to 1000 samples and input file as input.
MeanSDF.zip ( description ) ( download )

  Median:
SPSS-macro for calculating the median and quartiles of a variable (optionally for all values of a break variable) according to one of six different methods.
Median.sps ( description ) ( download )

  Miss2Sys:
SPSS-script to recode all missing values of all numeric variables to system missing values (useful if you want to import an SPSS data file with different missing values in R).
Miss2Sys.sbs ( description ) ( download )

  Part_tst:
SPSS-macro for testing the difference between two standardized regression coefficients of the same equation (one sample).
part_tst.sps ( description ) ( download )

  PCA
R-function to compute a principal components "factor" analysis (PCA) with varimax and promax rotation; different options for the number of components (factors): direct specification, parallel test criteria (random eigenvalues), or minimum eigenvalue; optionally specification of promax power, sorting of loadings, and matrices of factor scores (see also: RanEigen and Fa.promax)
pca.r  ( download )

  Plot.fitPoisNegb:
R function to plot the proportion of the observed counts and the fitted (expected) probabilities of the poisson and negative binomial distributed counts of a variable.
plot.fitPoisNegb.r ( download )

  Plot.KDNC:
R function to plot a kernel density curve overlayed by a normal curve.
plot.kdnc.r ( download )

  Plot.power:
R function to calculate and plot power of a one sample z-test of a sample mean
plot.power.r ( download )

  ProfSim:
SPSS-macro for calculating different measures of profile similarity based on two sets of variables.
ProfSim.sps (description: see comments at the end of the macro) ( download )

  prop.CI:
R function to calculate the confidence interval of a single proportion according to one of eleven methods (default: likelihood ratio method).
prop.CI.r (description: see comments of source file) ( download ) Example: ex_prop.CI.r ( download )

  RanEigen (Version 2.0):
Executable program for determining the number of components (factors) to retain in a principal component analysis (PCA) by using random eigenvalues (parallel analysis).
PACrit.zip ( how to install RanEigen? ) ( download self-extracting file ) ( APM article describing version 1.0 )

  RelDiff:
Executable program for computing the reliability of a difference score (gain score) according to Zimmerman & Williams (1982).
RelDiff.zip ( download )

  Reliability:
R function to simulate the SPSS procedure RELIABILITY.
reliability.r ( download )

  r_bis:
SPSS macro for computing a biserial correlation coefficient and its significance.
r_bis.sps ( download ) Example for using the macros r_bis and r_tetra:   Examp_r.sps ( download )

  R_Prob:
Execcutable program for calculating the significance, 95%-confidence interval, and Fisher's Z value of a Pearson correlation coefficient r (given sample size n).
R_Prob.zip ( download )

  r_tetra:
SPSS macro for computing a tetrachoric correlation coefficient and its significance (see also: TetCorr).
r_tetra.sps ( download ) Example for using the macros r_bis and r_tetra:  Examp_r.sps ( download )

  scores (R):
R-function to create scores (min, max, sum, sd, or mean) of variables. The user can specify the minimum number of valid values necessary for the score to be valid. If mean scores are requested it is possible to center them at the overall mean, to transform them to z-scores, or to transform them to POMP (percent of maximum possible) scores.
scores.r ( download ) Example: test_sc.r ( download )

   scores (Stata):
Stata ado-file to create a new variable of scores (min, max, sum, sd, or mean) of variables. The user can specify the minimum number of valid values necessary for the score to be valid. If mean scores are requested it is possible to center them at the overall mean, to transfrom the to z-scores, or to transform them to POMP (percent of maximum possible) scores. (To install you may copy the .ado- and the .hlp-file into your "\ado\plus\s\" folder - the recommended method, however, is to enter ssc install scores in Stata's command window.)
scores.ado ( download ) scores.hlp ( download )

  sim_CI:
R function to simulate and create (animated) plots of confidence intervals (employing either t- or normal-distribution) by drawing a user specified number of samples of user specified size from the normal distribution with user specified mu and sigma. Optional output contains sample statistics and coverage rate of confidence intervals.
sim_CI.r ( download ) Example: CI_demo.r ( download )

  Skewness:
R function to compute the unbiased population estimate or biased sample statistic of skewness.
skewness.r ( download )

   sortl (Stata):
Stata ado-file to sort rotated factor loadings (pattern matrix) or components previously created by the postestimation command -rotate-. Sorting of loadings or components by size facilitates the interpretation of a factor solution. -sortl- will save a matrix of sorted loadings or components into the matrix e(r_Ls), and it will save a matrix of uniqueness or unexplained variance of the variables sorted into the same order into the matrix e(Psis). (To install you may copy the .ado- and the .hlp-file into your "\ado\plus\s\" folder - the recommended method, however, is to enter ssc install sortl in Stata's command window.)
sortl.ado ( download ) sortl.hlp ( download )

  SPSS2Stata:
SPSS script for converting an SPSS data file (.sav) into a Stata/SE data file (.dta). The script now supports variable names longer than 8 characters. Nevertheless, you may find the Stata ado -usespss- useful, too (to install enter ssc install usespss in Stata's command window). However, in contrast to the script and similar to StatTransfer -usespss- ignores value labels of missing values.
spss2stata.sbs ( description ) ( download )

  t_Test:
Executable program for testing the difference in means between two indepedent samples (given means, standard deviations and sample sizes of both samples).
t_Test.zip ( description ) ( download )

  TabNotes:
Windows program to convert .not-files created by the data entry software EpiData (see: http://www.epidata.dk/index.htm) containing data entry notes into a tabulator-delimited file (for example, to export the notes into an Excel file).
TabNotes.zip ( description ) ( download )

  TetCorr:
DOS program and source code (Pascal) for computing a matrix of tetrachoric correlation coefficients of up to 50 variables and a maximum of 8,000 cases (see also: r_tetra).
TetCorr.zip ( description ) ( download )

  TRd:
For computing the Satorra-Bentler scaled chi-square difference test (TRd) based on the MLM estimators obtained by MPlus, see: http://www.statmodel.com/chidiff.html
TRd.zip ( download )

  VDef2SPS:
SPSS script for creating SPSS syntax to define the variables (variable labels, value labels, and missing values) according to the definitions of a specific SPSS data file (*.sav).
VDef2SPS.sbs ( description ) ( download )


Some other useful things:

[last update: November 21, 2009]
  Mitarbeiter Projekte Lehre Links Stadtplan Home