Monday, December 29, 2008

Chapter 2, Exercise 6, pg 33-34 (basic bivariate regression)

Exercise 6 has been posted on the companion web page. This exercise covers bivariate regression in the R statistical computing program. First a brief example of how to manually calculate regression coefficients using formulas 2.4.3 and 2.4.4 is provided. Then, the linear model function lm() is used to specify a basic regression model. The summary() function is then used to show model results. This exercise uses the data set C0206DT from the book's CD.

Advanced Structural Equation Modeling modeling in R

This Summer the researchers Boker, Neal, and Maes from the Unviersity of Virginia will be releasing the first beta test of their Structural Equation Modeling (SEM) software, OpenMX. OpenMX is a port and upgrade of the late statistical modeling program MX which will now be integrated into the R statistical computing environment. This program will provide a large increase in the accessibility, efficiency, and utility of the MX software. The OpenMX team promises extensive documentation so that students having only entry level knowledge of SEM will be able to learn and use this software.

Advanced options and estimators ranging from multi-level modeling, nuero imaging, dynamical systems, and mixed modeling to Full Information Maximum Likelihood estimation will be available in OpenMx. This software will also provide a graphical user interface in which models can be specified by path diagrams. This will be a massive improvement on the availability of structural equation modeling software in R.

Closed beta starts in January (2009) and open beta will begin this summer (2009).

See documentation here
Website here

Saturday, December 20, 2008

Chapter 2, Exercise 5, pg 45,49, 54,55 (correlation continued)

Posted on the companion web page is exercise 5, which covers how to obtain confidence intervals, and tests of significance for the basic bivariate correlation, the Spearman rank order correlation, the point biserial correlation, and the phi coefficient using the cor.test function in the R statistical computing program.

This covers pages 45 and 49 in the book and expands the exposition past basic bivariate correlation.

The second part of this exercise covers polychoric and polyserial correlation which is described on page 54 and 55 in the text. Specifically the book covers biserial correlation (not to be confused with point biserial correlation) and tetrachoric correlation. Both of these correlations concern variables (either one or two) that are artificially dichotomous. An example of an artificially dichotomous variable could be a variable that concerns a population that is best described on a continuum, yet is categorical in a data set (e.g. depressed, not depressed). The R package called polycor is used for these coefficients.

Friday, December 12, 2008

Some Useful Links for Psychological Research In R

I have posted some useful links on the bottom right hand side of the blog. All of these links concern R applications for psychology. You will find R syntax, packages, and other resources related to psychological research at each of these pages. below are the links and a brief description:


http://www.statmethods.net/index.html :This site contains a wealth of information on R. This is an excellent site to bookmark for R questions. This covers everything from data manipulation and basic statistics to advanced statistics and advanced graphical applications.

http://www.personality-project.org/r/ :this site covers the psych package for R. This package provides some basic statistical applications of R that are pertinent to the psychological sciences.

http://cran.r-project.org/web/packages/QuantPsyc/QuantPsyc.pdf :this is the manual for the QuantPsyc R package which contains several functions that aid in investigating statistical mediation, moderation, and multivariate assumptions.It also has a useful application of the boot command for bootstrapping parameters of basic mediation models.

http://cran.r-project.org/doc/manuals/R-intro.pdf :this is the manual for statistical applications in R. It can be rather confusing, yet will make navigating R much easier if it is read.

http://cran.r-project.org/doc/contrib/Baron-rpsych.pdf :this is a manual for conducting research with survey data. It covers the basics of manipulating and investigating such data (making composites, finding various reliabilities, etc.).

http://gking.harvard.edu/amelia/ :This is arguably the most user friendly and sophisticated multiple imputation program for R. It can be ran in or outside of R. This program imputes data under the assumption of Missing at Random, and uses a bootstrapping based EM algorithm. This is a great program to quickly and easily deal with missing data. It is recommended that the user read the manual before use.

Thursday, December 11, 2008

Chapter 2, Exercise 4; pg 31: table 2.3.2 (CCAW)

Posted on the companion web page is the 4th exercise for chapter 2, which shows how to create the phi correlation coefficient (i.e. correlation between two dichotomous variables) and the spearman rank order correlation (i.e. correlation between data that are rank ordered). Use data sets C0204dt.txt and C0204DT.txt from the Cohen Cohen Aiken West text.

Chapter 2, Exercise 3; pg 30 table 2.3.1

The 3rd exercise has been posted on the the companion web page. This exercise covers how to create the point biserial correlation coefficient in the R statistical computing program.

This exercise is the R counterpart to exercise CH02EX02 in the book;however it is the third exercise on this blog. The next post will cover how to obtain the phi-coefficient and the rank correlation. Use the data set C02030DT.txt from your book's CD.

Tuesday, December 9, 2008

Chapter 2, Exercise 2: pg 27, table 2.2.2

I have added the second exercise, which corresponds to the table 2.2.2 on page 27 in the book. Get the R syntax and comments from the companion sites.google page or simply click "second exercise" in the first sentence of this paragraph.This exercise will again show you how to use R for algebra computations, and then how r makes statistical computation easy for you. The data set for this file is C0202DT (On your Book Disk). Pay particular attention on the order of operations in creating the correlation coefficient manually.

Chapter 2, Exercise 1: pg 24-26 (CCAW)

If you look to the top right of this page, you will see a link below the heading

"Companion Google Site for Code"

http://sites.google.com/site/pilgrimregression/

This site will house all of the R syntax for the Cohen, Cohen, Aiken, West Text Applied Multiple Regression/Correlation Analysis for the Behavioral Sciences (3rd)

The First set of syntaxt is for the first, and most basic, exercise in the book--Chapter 2, Exercise 1. The data file from the book disk that corresponds to this exercise is C0201DT. This, as well as the other more basic exercises, will be used to orient the user to R. Thus, if you already know what a standard deviation or a z score is it will still be beneficial to work through these to build fluency in the basic commands.

A quick note on the syntax: If you see "#" before text, this means that I am about to make a comment or explain what happened above or below. If you are writing code and would like to make a note simply type #, and anything after that R will ignore. This is how I will explain the syntax.