ResultsEff0001

From InterSciWiki
Jump to: navigation, search
  • Wald, Abraham. 1943. Tests of Statistical Hypotheses Concerning Several Parameters When the Number of Observations is Large. Transactions of the American Mathematical Society 54: 426-482.
  • #Read in the dbf format weight matrices-the dbf file is 186x186 (no row names)
  • #Comment the matrix you do NOT want to use
  • lds<-read.dbf("langmat.dbf") #language phylogeny
  • #lds<-read.dbf("distmat.dbf") #great circle distance
  • #convert to matrix
  • lds<-as.matrix(lds)
  • #take a quick look at the upper left hand corner to see that it is OK
  • lds[1:5,1:5]
  X1 X2 X3 X4 X5
1  0  3  1  1  1
2  3  0  1  1  1
3  1  1  0  3  3
4  1  1  3  0  3
5  1  1  3  3  0
  • #read in SCCS data. It is in STATA format, since this is numeric--there are problems with the SPSS version,
  • #since R imports the value labels from SPSS and the variables become non-numeric
  • gg<-read.dta("SCCS_stata.dta")
  • length(gg[,1]) #the number of observations

[1] 186

  • length(gg[1,]) #the number of variables

[1] 1849

  • #create a data frame containing our variables, also give the variables names
  • df<-data.frame(femsubs=gg$v826,fishimp=gg$v816,huntimp=gg$v817,pathstress=gg$v1260,rainfall=gg$v855,polygamy=gg$v79,eboysxp=gg$v353,fixres=gg$v150,landtrans=gg$v154,polinteg=gg$v157,socstrat=gg$v158)
  • #since the estimation doesn't work with missing values, here we identify all observations with non-missing values
  • kk<-as.matrix(df)
  • oo<-matrix(1,length(kk[1,]),1)
  • tm<-kk%*%oo
  • rr<-which(tm[,1]!="NA")
  • #here we restrict the weight matrix and data to include only non-missing values
  • wmat<-mat2listw(lds[rr,rr])
  • ffd<-df[rr,]
  • length(df[,1]) #number of observations before dropping those with missing values

[1] 186

  • length(ffd[,1]) #number of observations after dropping those with missing values

[1] 180

  • summary(ffd)
   femsubs         fishimp         huntimp        pathstress   
Min.   : 0.00   Min.   : 0.00   Min.   : 0.00   Min.   : 7.00  
1st Qu.:21.00   1st Qu.: 5.00   1st Qu.: 5.00   1st Qu.: 9.00  
Median :32.50   Median : 5.00   Median : 5.00   Median :12.00  
Mean   :32.74   Mean   :15.89   Mean   :15.28   Mean   :12.55  
3rd Qu.:42.25   3rd Qu.:25.00   3rd Qu.:25.00   3rd Qu.:15.25  
Max.   :79.00   Max.   :90.00   Max.   :80.00   Max.   :21.00  
   rainfall        polygamy        eboysxp          fixres     
Min.   :1.000   Min.   :1.000   Min.   :2.000   Min.   :1.000  
1st Qu.:1.750   1st Qu.:3.000   1st Qu.:3.000   1st Qu.:2.000  
Median :3.000   Median :3.000   Median :3.000   Median :5.000  
Mean   :3.278   Mean   :3.128   Mean   :3.367   Mean   :3.722  
3rd Qu.:5.000   3rd Qu.:4.000   3rd Qu.:3.250   3rd Qu.:5.000  
Max.   :7.000   Max.   :4.000   Max.   :5.000   Max.   :5.000  
  landtrans        polinteg        socstrat    
Min.   :1.000   Min.   :1.000   Min.   :1.000  
1st Qu.:1.000   1st Qu.:2.000   1st Qu.:1.000  
Median :1.000   Median :3.000   Median :2.000  
Mean   :1.783   Mean   :2.944   Mean   :2.439  
3rd Qu.:2.000   3rd Qu.:4.000   3rd Qu.:4.000  
Max.   :5.000   Max.   :5.000   Max.   :5.000  
  • #We estimate a spatial lag model
  • col.lm<-lagsarlm(femsubs~fishimp+huntimp+pathstress+rainfall+polygamy+eboysxp+fixres+landtrans+polinteg+socstrat,
  • + data=ffd,wmat,quiet=FALSE)
Spatial lag model
Jacobian calculated using neighbourhood matrix eigenvalues
Computing eigenvalues ...

(eigen) rho:     -0.2003254     function value:  -1196.641 
(eigen) rho:     -0.1181220     function value:  -1063.774 
(eigen) rho:     -0.06731753    function value:  -955.0824 
(eigen) rho:     -0.03591862    function value:  -858.619 
(eigen) rho:     -0.01651303    function value:  -780.7875 
(eigen) rho:     -0.004519716   function value:  -736.6456 
(eigen) rho:     0.002892561    function value:  -724.8947 
(eigen) rho:     0.006528       function value:  -726.4253 
(eigen) rho:     0.003551092    function value:  -724.7921 
(eigen) rho:     0.00362369     function value:  -724.791 
(eigen) rho:     0.003625334    function value:  -724.791 
(eigen) rho:     0.003625231    function value:  -724.791 
(eigen) rho:     0.003625226    function value:  -724.791 
(eigen) rho:     0.003625236    function value:  -724.791 
(eigen) rho:     0.003625231    function value:  -724.791 
  • #this next displays parameter estimates and diagnostics for the spatial lag model
  • summary(col.lm)
Call:lagsarlm(formula = femsubs ~ fishimp + huntimp + pathstress + 
   rainfall + polygamy + eboysxp + fixres + landtrans + polinteg + 
   socstrat, data = ffd, listw = wmat, quiet = FALSE)
Residuals:
     Min       1Q   Median       3Q      Max 
-31.0141  -9.7284  -1.0099   9.3039  41.2642 
Type: lag 
Coefficients: (asymptotic standard errors) 
             Estimate Std. Error z value  Pr(*|z|)
(Intercept) 42.629091   9.235650  4.6157 3.918e-06
fishimp     -0.178894   0.064200 -2.7865 0.0053277
huntimp     -0.390293   0.079525 -4.9078 9.209e-07
pathstress  -1.359711   0.382740 -3.5526 0.0003815
rainfall    -1.970160   0.640417 -3.0764 0.0020954
polygamy     2.557231   1.682321  1.5201 0.1284956
eboysxp      4.902086   1.706921  2.8719 0.0040803
fixres      -1.348417   0.876313 -1.5387 0.1238681
landtrans   -1.720732   1.153186 -1.4922 0.1356585
polinteg     2.203866   1.305567  1.6881 0.0914011
socstrat    -2.667423   1.103580 -2.4171 0.0156463

Rho: 0.0036252 LR test value: 4.9754 p-value: 0.02571 
Asymptotic standard error: 0.0015828 z-value: 2.2904 p-value: 0.021995 
Wald statistic: 5.2462 p-value: 0.021995 
Log likelihood: -724.791 for lag model
ML residual variance (sigma squared): 183.87, (sigma: 13.56)
Number of observations: 180 
Number of parameters estimated: 13 
AIC: 1475.6, (AIC for lm: 1478.6)
LM test for residual autocorrelation
test value: 0.14304 p-value: 0.70528

The model evaluated regression coefficients predicting female contribution to subsistence

  • femsubs~fishimp+huntimp+pathstress+rainfall+polygamy+eboysxp+fixres+landtrans+polinteg+socstrat
variables having .15 > p > .10: polygamy fixres landtrans
variables having .10 > p > .05: polinteg (+)
variables having .05 > p > .01: socstrat (-)
variables having .01 > p >.001: rainfall eboysxp (+) fishimp (-)
variables having .001>p: hunting path(ogen)stress (-)

Residual autocorrelation is nonsignificant

Personal tools