R2slsPlus User Manual

From InterSciWiki
Jump to: navigation, search


Names of packages

  • Eff-Dow package
  • Scott 1 package *Rccs*
  • Scott 2 package *R2sls*
  • Scott 3 package R2sls+
  • R2sls package features
  • (manual to be drafted)

RData for Standard Cross-Cultural Sample

  • SCCS.Rdata and sccs.Rdata the same.

Fall 2010 course

Compute a correlation 
setwd("C:/My Documents/sccs") 
library(sccs)
data(sccs)
ww<-table((sccs$v238==4)*1,(sccs$v237==4)*1) #Moral gods and Evil eye
ww<-table(sccs$v238,(sccs$v237)*1) #Moral gods and Evil eye
ww
ww<-ww/rowSums(ww)
ww <- round(ww,3)
ww 
rowSum <- round(rowSums(ww),3)
rowSum

Make a a crosstab (row normalize) with percentages

setwd("C:/My Documents/sccs")             
library(sccs)
data(sccs)
table(sccs$v245,sccs$v858,useNA="ifany") 
   1  2  3  4  5  6  7  8  9 11 12 pastoral= 6
 1 9  9 12  8  5  2 29 15 17 11 12  <-- 2 have no milked animals
 2 0  0  0  0  0 16  4  4  1 12 20  <-- This 16/18 pastoral societies have milked animals
library(spdep) 
ww<-table(sccs$v245,sccs$v858,useNA="ifany") 
ww<-ww/rowSums(ww)
ww <- round(ww,3)
ww