[Rsiena-commits] r125 - in pkg: RSiena RSiena/R RSiena/inst/doc RSiena/man RSiena/src/model/effects RSiena/tests RSienaTest RSienaTest/R RSienaTest/data RSienaTest/doc RSienaTest/inst/doc RSienaTest/man RSienaTest/src RSienaTest/src/data RSienaTest/src/model RSienaTest/src/model/effects RSienaTest/src/model/ml RSienaTest/src/model/variables RSienaTest/tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Nov 7 13:38:37 CET 2010
Author: ripleyrm
Date: 2010-11-07 13:38:33 +0100 (Sun, 07 Nov 2010)
New Revision: 125
Added:
pkg/RSienaTest/src/model/effects/InStructuralEquivalenceEffect.cpp
pkg/RSienaTest/src/model/effects/InStructuralEquivalenceEffect.h
Modified:
pkg/RSiena/DESCRIPTION
pkg/RSiena/R/phase1.r
pkg/RSiena/R/phase3.r
pkg/RSiena/R/print07Report.r
pkg/RSiena/R/robmon.r
pkg/RSiena/R/sienaDataCreate.r
pkg/RSiena/R/sienaTimeTest.r
pkg/RSiena/R/simstatsc.r
pkg/RSiena/changeLog
pkg/RSiena/cleanup.win
pkg/RSiena/inst/doc/s_man400.pdf
pkg/RSiena/man/RSiena-package.Rd
pkg/RSiena/man/siena01Gui.Rd
pkg/RSiena/src/model/effects/DenseTriadsEffect.cpp
pkg/RSiena/tests/parallel.R
pkg/RSiena/tests/parallel.Rout.save
pkg/RSienaTest/DESCRIPTION
pkg/RSienaTest/R/initializeFRAN.r
pkg/RSienaTest/R/phase1.r
pkg/RSienaTest/R/phase3.r
pkg/RSienaTest/R/print07Report.r
pkg/RSienaTest/R/printDataReport.r
pkg/RSienaTest/R/robmon.r
pkg/RSienaTest/R/sienaDataCreate.r
pkg/RSienaTest/R/sienaModelCreate.r
pkg/RSienaTest/R/sienaTimeTest.r
pkg/RSienaTest/R/sienaprint.r
pkg/RSienaTest/changeLog
pkg/RSienaTest/data/allEffects.csv
pkg/RSienaTest/doc/RSiena.bib
pkg/RSienaTest/doc/RSienaDeveloper.tex
pkg/RSienaTest/doc/Siena_algorithms4.tex
pkg/RSienaTest/doc/s_man400.tex
pkg/RSienaTest/doc/simstats0c.tex
pkg/RSienaTest/inst/doc/s_man400.pdf
pkg/RSienaTest/man/RSiena-package.Rd
pkg/RSienaTest/man/siena01Gui.Rd
pkg/RSienaTest/man/sienaModelCreate.Rd
pkg/RSienaTest/src/data/OneModeNetworkLongitudinalData.cpp
pkg/RSienaTest/src/data/OneModeNetworkLongitudinalData.h
pkg/RSienaTest/src/model/EpochSimulation.cpp
pkg/RSienaTest/src/model/Model.h
pkg/RSienaTest/src/model/effects/AllEffects.h
pkg/RSienaTest/src/model/effects/DenseTriadsEffect.cpp
pkg/RSienaTest/src/model/effects/EffectFactory.cpp
pkg/RSienaTest/src/model/ml/MLSimulation.cpp
pkg/RSienaTest/src/model/variables/BehaviorVariable.cpp
pkg/RSienaTest/src/model/variables/DependentVariable.cpp
pkg/RSienaTest/src/model/variables/DependentVariable.h
pkg/RSienaTest/src/model/variables/NetworkVariable.cpp
pkg/RSienaTest/src/model/variables/NetworkVariable.h
pkg/RSienaTest/src/siena07internals.cpp
pkg/RSienaTest/src/siena07models.cpp
pkg/RSienaTest/tests/parallel.R
pkg/RSienaTest/tests/parallel.Rout.save
Log:
sienaTimeTest, instructuraleq effect, symmetric networks
Modified: pkg/RSiena/DESCRIPTION
===================================================================
--- pkg/RSiena/DESCRIPTION 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/DESCRIPTION 2010-11-07 12:38:33 UTC (rev 125)
@@ -1,8 +1,8 @@
Package: RSiena
Type: Package
Title: Siena - Simulation Investigation for Empirical Network Analysis
-Version: 1.0.11.124
-Date: 2010-10-22
+Version: 1.0.11.125
+Date: 2010-11-07
Author: Various
Depends: R (>= 2.9.0), xtable
Imports: Matrix
Modified: pkg/RSiena/R/phase1.r
===================================================================
--- pkg/RSiena/R/phase1.r 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/R/phase1.r 2010-11-07 12:38:33 UTC (rev 125)
@@ -480,7 +480,7 @@
# zdummy <- z[c('theta', 'Deriv', 'cconditional', 'FinDiff.method',
# 'int2', 'cl')]
zdummy <- makeZsmall(z)
- if (!z$fixed[i])
+ if (z$Phase == 3 || !z$fixed[i])
{
zdummy$theta[i] <- z$theta[i] + z$epsilon[i]
}
Modified: pkg/RSiena/R/phase3.r
===================================================================
--- pkg/RSiena/R/phase3.r 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/R/phase3.r 2010-11-07 12:38:33 UTC (rev 125)
@@ -312,7 +312,7 @@
'iterations,\n'), outf)
if (!x$maxlike && z$cconditional)
Report(c('basic rate parameter',
- c('', 's')[as.integer(z$observations > 2) + 1],
+ c('', 's')[as.integer(z$f$observations > 2) + 1],
' as well as \n'), sep='', outf)
Report(c('convergence diagnostics, covariance and derivative matrices based on ',
z$Phase3nits, ' iterations.\n\n'), sep='', outf)
Modified: pkg/RSiena/R/print07Report.r
===================================================================
--- pkg/RSiena/R/print07Report.r 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/R/print07Report.r 2010-11-07 12:38:33 UTC (rev 125)
@@ -11,6 +11,7 @@
##@PrintReport siena07 Print report
PrintReport <- function(z, x)
{
+ types <- attr(z$f, "types")
Report('\n\n', outf)
Heading(2, outf, "Estimation Results.")
if (!z$OK)
@@ -74,8 +75,8 @@
Report('\nOther parameters:\n', bof)
}
}
- nBehavs <- sum(z$types == "behavior")
- nNetworks <- length(z$types) - nBehavs
+ nBehavs <- sum(types == "behavior")
+ nNetworks <- length(types) - nBehavs
if (nBehavs > 0 && nNetworks > 0)
{
Report("Network Dynamics\n", outf)
Modified: pkg/RSiena/R/robmon.r
===================================================================
--- pkg/RSiena/R/robmon.r 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/R/robmon.r 2010-11-07 12:38:33 UTC (rev 125)
@@ -127,7 +127,7 @@
else
{
Report('Number of subphases is specified as 0.\n', outf)
- Report('0 subphases; no estimationl only phase 3.\n', lf)
+ Report('0 subphases; no estimation: only phase 3.\n', lf)
}
Report(c('Therefore the estimation phase is skipped\n',
'and the program passes on immediately to phase 3\n',
Modified: pkg/RSiena/R/sienaDataCreate.r
===================================================================
--- pkg/RSiena/R/sienaDataCreate.r 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/R/sienaDataCreate.r 2010-11-07 12:38:33 UTC (rev 125)
@@ -293,7 +293,7 @@
)
if (v1 == 0)
{
- stop('need a network')
+ stop('need a dependent variable')
}
depvars <- depvars[1:v1]
if (is.null(nodeSets))
@@ -543,7 +543,11 @@
attr(compositionChange[[i]], "activeStart") <- activeStart
attr(compositionChange[[i]], "action") <- action
}
- for (i in 1:v1)
+ ## dependent variables. First we sort the list so behavior are at the end
+ types <- sapply(depvars, function(x)attr(x, "type"))
+ depvars <- depvars[c(which(types !='behavior'), which(types =="behavior"))]
+
+ for (i in 1:v1) ## dependent variables
{
nattr <- attr(depvars[[i]], 'nodeSet')
netdims <- attr(depvars[[i]], 'netdims')
Modified: pkg/RSiena/R/sienaTimeTest.r
===================================================================
--- pkg/RSiena/R/sienaTimeTest.r 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/R/sienaTimeTest.r 2010-11-07 12:38:33 UTC (rev 125)
@@ -12,126 +12,121 @@
##@sienaTimeTest siena07 Does test for time homogeneity of effects
sienaTimeTest <- function (sienaFit, effects=NULL, condition=FALSE)
{
- observations <- sienaFit$f$observations
+ observations <- attr(sienaFit$f, "groupPeriods")
+ periodNos <- attr(sienaFit$f, "periodNos")
+ fitEffects <- sienaFit$requestedEffects
# There must be more than 2 observations to do a time test!
- if (observations <=2)
+ if (length(periodNos) < 2)
{
- stop("You must have at least three time periods to test
- for non-heterogeneity across time.")
+ stop("You must have at least three time periods to test ",
+ "for non-heterogeneity across time.")
}
- ## Screen out the undesired effects
- if (!is.null(effects)) {
- escreen = setdiff(1:nrow(sienaFit$effects), effects)
- } else {
- escreen = 99999
+ ## get the desired effects
+ if (!is.null(effects))
+ {
+ ## a little validation helps ensure we have at least one effect we want
+ if (any(!is.numeric(effects)) ||
+ any(!effects %in% 1:nrow(fitEffects)))
+ {
+ stop("non numeric effect number requested")
+ }
+ if (any(fitEffects$basicRate[effects]))
+ {
+ stop("siena time tests are inappropriate for basic rates")
+ }
+ use <- (1:nrow(fitEffects)) %in% effects
}
- # Identify which effects are rate parameters
- indRateEffects <- which(sienaFit$effects$shortName[-escreen]=="Rate")
- # Identify which effects are estimated dummy terms
- indDummiedEffects <- grep("Dummy", sienaFit$effects$effectName[-escreen])
- # The effects which will be tested are stored here. Take all of the
- # effects, and take out the rate and dummy effects. These indices
- # will have to be changed for the moments, scores, etc. after we
- # screen the sienaFit ingredients.
- indBaseEffects <- setdiff(1:nrow(sienaFit$effects[-escreen,]), c(indRateEffects,
- indDummiedEffects))
- baseNames=sienaFit$effects[-escreen,]$effectName[indBaseEffects]
+ else
+ {
+ use <- rep(TRUE, nrow(fitEffects))
+ }
+ nUse <- sum(use)
+
+ ## Identify the rate parameters
+ indRateEffects <- fitEffects$basicRate
+ # Identify the are estimated dummy terms
+ indDummiedEffects <- grepl("Dummy", fitEffects$effectName)
+ # Identify the effects which will potentially be tested
+ indBaseEffects <- use & !indRateEffects & !indDummiedEffects
+ nBaseEffects <- sum(indBaseEffects)
+ if (nBaseEffects == 0)
+ {
+ stop("No effects available to test")
+ }
+ baseNames <- fitEffects$effectName[indBaseEffects]
+ fixedDummies <- fitEffects$shortName=='egoX' &
+ fitEffects$fix & grepl("Dummy", fitEffects$effectName)
+
+ ## establish topleft effects
+ topleft <- use & !indRateEffects & !fixedDummies
+
# toTest will hold booleans for which of the time dummies have not
# been estimated and thus are candidates for time tests.
- toTest <- array(TRUE, dim=c(length(indBaseEffects),
- sienaFit$f$observations - 2))
- rownames(toTest) <- sienaFit$effects[-escreen,]$effectNumber[indBaseEffects]
- colnames(toTest) <- 2:(sienaFit$f$observations - 1)
- # dummyByEffect gets passed from sienaTimeTest so that other functions
- # know which dummies belong to which base effects.
- dummyByEffect <- array(0, dim=c(length(indBaseEffects),
- sienaFit$f$observations - 2))
- dimnames(dummyByEffect) <- dimnames(toTest)
- # dscreen is the first important screening vector, which will determine
- # which egoX dummies are fixed, so that we do not consider them as included
- dscreen <- which(sienaFit$effects[-escreen,]$shortName=='egoX' &
- sienaFit$effects[-escreen,]$fix
- & length(grep("Dummy",
- sienaFit$effects[-escreen,]$effectName)) > 0)
- if (length(dscreen)==0)
- {
- dscreen <- 99999
- }
- ## If the estimation was unconditional, the rate parameters will have scores
- ## and moments which must also be screened out. Ruth, is there a simple way to
- ## check conditioning? I tried $conditional and it doesnt seem to do what I
- ## intuitively expected. For now, I just check the dimensionality of the scores,
- ## as it will match the number of included "effects" on dimension 3 if uncond.
- ## estimation was used.
- if (dim(sienaFit$sf2[,,-escreen, drop=FALSE])[3] == dim(sienaFit$effects)[1]) {
- rscreen <- indRateEffects
- } else {
- rscreen <- 99999
- }
- ## Go through each effect which had a time dummy included, and incorporate this
- ## information into the toTest vector. i.e. if a time dummy was estimated, set
+
+ toTest <- matrix(TRUE, nBaseEffects, length(periodNos) - 1)
+ rownames(toTest) <- fitEffects$effectNumber[indBaseEffects]
+ colnames(toTest) <- periodNos[-1]
+
+ ## dummyByEffect gets passed from sienaTimeTest so that other functions
+ ## know which dummies belong to which base effects.
+ dummyByEffect <- toTest
+ dummyByEffect[] <- TRUE
+
+ ## Go through each effect which is an estimated time dummy, and
+ ## incorporate this information into the toTest vector. i.e.
+ ## if a time dummy was estimated, set
## its element in toTest equal to FALSE so that we do not time test it
- for (i in sienaFit$effects[-escreen,]$effectNumber
- [sienaFit$effects[-escreen,]$timeDummy != ',']){
- tmp <- toString(sienaFit$effects[-escreen,]$timeDummy[
- sienaFit$effects[-escreen,]$effectNumber == i])
- tmp <- strsplit(tmp, split=",", fixed=TRUE)[[1]]
- if (length(which(!tmp == '')) > 0)
- {
- ## The effect we are looking at is a time dummy.
- if (tmp[1]=='isDummy' & !(i %in% sienaFit$effects[-escreen,]$
- effectNumber[dscreen]))
- {
- ## Dont test this dummy...
- toTest[rownames(toTest)==as.numeric(tmp[3]),
- colnames(toTest)==as.numeric(tmp[2])] <- FALSE
- ## We want to be able to reference this effect given an
- ## index for the base effect and a time period, so store
- ## this information in dummyByEffect -- this is used
- ## extensively in plot.sienaTimeTest
- dummyByEffect[rownames(toTest)==as.numeric(tmp[3]),
- colnames(toTest)==as.numeric(tmp[2])] <-
- which(sienaFit$effects[-escreen,]$
- effectNumber[-c(rscreen,dscreen)]==i)
- }
+ for (i in which(grepl("isDummy", fitEffects$timeDummy) & use &
+ !fixedDummies))
+ {
+ tmp <- toString(fitEffects$timeDummy[i])
+ tmp <- strsplit(tmp, split=",", fixed=TRUE)[[1]]
+ if (any(tmp != ""))
+ {
+ ## Dont test the dummy for the corresponding effect
+ toTest[tmp[3], tmp[2]] <- FALSE
+ ## We want to be able to reference this effect given an
+ ## index for the base effect and a time period, so store
+ ## this information in dummyByEffect -- this is used
+ ## extensively in plot.sienaTimeTest
+ dummyByEffect[tmp[3], tmp[2]] <-
+ match(fitEffects$effectNumber[i],
+ fitEffects$effectNumber[topleft])
+ }
+ }
- }
- else
- {
- ## The effect we are looking at had a time dummy,
- ## nothing required for now.
- next
- }
- }
## nEffects, nSims, nameslist, nDummies convert commonly used ingredients
## from sienaFit into an easily accessed form based on the screens
## set up above
- nEffects <- length(indBaseEffects) + sum(!toTest)
+
+ nEffects <- sum(indBaseEffects) + sum(!toTest)
+ ## this should be the same as sum(topleft)?
+
## With the use of multiple nodes, sometimes the sienaFit object comes back
## with the wrong number of iterations!! Fixing it by looking elsewhere:
## Used to be: nSims <- sienaFit$n3
- nSims <- dim(sienaFit$sf2[,,-escreen])[1]
- nameslist <- list(
- Iteration=paste("it", 1:nSims, sep=""),
- Wave=paste("Wave", 1:(observations - 1), sep=""),
- Effect=sienaFit$effects[-escreen,]$effectName[-c(dscreen,rscreen)]
- )
+ nSims <- dim(sienaFit$sf2)[1]
+
+ nameslist <- list(
+ Iteration=paste("it", 1:nSims, sep=""),
+ Wave=paste("Wave", periodNos, sep=""),
+ Effect=fitEffects$effectName[topleft]
+ )
nDummies <- sum(toTest)
nTotalEffects <- nDummies + nEffects
## obsStats, moment, scores are the crucial ingredients from sienaFit which
## screen for the base effects and make the rest of the code clean
- obsStats <- t(sienaFit$targets2[-c(dscreen,rscreen,escreen), ])
- moment <- sienaFit$sf2[, , -c(dscreen,rscreen,escreen), drop=FALSE] -
- rep(obsStats, each=nSims)
- scores <- sienaFit$ssc[ , , -c(dscreen,rscreen,escreen), drop=FALSE]
+ obsStats <- t(sienaFit$targets2[topleft, ])
+ moment <- sienaFit$sf2[, , topleft, drop=FALSE] - rep(obsStats, each=nSims)
+ scores <- sienaFit$ssc[ , , topleft, drop=FALSE]
## Because the sienaFit object does not have a strict class definition,
## the $sf2 and $targets2 arrays cannot be expected to always have the
## proper format. The best we can do is therefore to die gracefully if
## the arrays do not line up:
- G <- array(0, dim=c(nSims, observations - 1, nEffects + nDummies))
- SF <- array(0, dim=c(nSims, observations - 1, nEffects + nDummies))
- if (sum(dim(G[, , 1:nEffects, drop=FALSE]) != dim(moment))+
- sum(dim(SF[, , 1:nEffects, drop=FALSE]) != dim(scores))>0) {
+ G <- SF <- array(0, dim=c(nSims, length(periodNos) ,
+ nEffects + nDummies))
+ if (any(dim(G[, , 1:nEffects, drop=FALSE]) != dim(moment)) ||
+ any(dim(SF[, , 1:nEffects, drop=FALSE]) != dim(scores))) {
stop("The moments and scores in your sienaFit have unexpected dimensions.\n
It is possible that your model specifications are not yet implemented\n
in sienaTimeTest. Please contact the developers.\n\nDid you include
@@ -141,9 +136,10 @@
dummyNames <- rep("", nDummies)
## Set the base effects G equal to the moments from sienaFit
G[, , 1:nEffects] <- moment
+
## inc used for incrementing through the dummies
inc <- nEffects
- for (i in 1:nrow(toTest))
+ for (i in row.names(toTest))
{
for (j in 1:ncol(toTest))
{
@@ -151,10 +147,12 @@
if (toTest[i, j])
{
inc <- inc + 1
- ## And add scores and moments for the specific time period j+1
- G[, j + 1, inc] <- moment[, j + 1, i]
- dummyNames[inc-nEffects] <- paste("(*)Dummy", j + 1, ":",
- nameslist$Effect[i], sep="")
+ ii <- match(i, fitEffects$effectNumber[topleft])
+ ## And add moments for the specific time period j+1
+ G[, j + 1, inc] <- moment[, j + 1, ii]
+ dummyNames[inc - nEffects] <-
+ paste("(*)Dummy", periodNos[j + 1], ":",
+ nameslist$Effect[ii], sep="")
}
}
}
@@ -167,20 +165,22 @@
SF[, , 1:nEffects] <- scores
inc <- nEffects
dummyProps <- list()
- for (i in 1:nrow(toTest))
+ for (i in row.names(toTest))
{
for (j in 1:ncol(toTest))
{
if (toTest[i, j])
{
inc <- inc + 1
- SF[, j + 1, inc] <- scores[, j + 1, i]
+ ii <- match(i, fitEffects$effectNumber[topleft])
+ SF[, j + 1, inc] <- scores[, j + 1, ii]
## Save some information on these dummies for later;
## these operations dont relate directly to the scores
- dummyByEffect[i, j]=inc
- dummyProps$shortName[inc] <- sienaFit$effects[-escreen,]$shortName[i]
- dummyProps$interaction1[inc] <- sienaFit$effects[-escreen,]$interaction1[i]
- dummyProps$type[inc] <- sienaFit$effects[-escreen,]$type[i]
+ dummyByEffect[i, j] <- inc
+ dummyProps$shortName[inc] <- fitEffects$shortName[topleft][ii]
+ dummyProps$interaction1[inc] <-
+ fitEffects$interaction1[topleft][ii]
+ dummyProps$type[inc] <- fitEffects$type[topleft][ii]
dummyProps$period[inc] <- j + 1
}
}
@@ -194,51 +194,61 @@
doTests <- c(rep(FALSE, nEffects), rep(TRUE, nDummies))
jointTest <- ScoreTest(nTotalEffects, D, sigma, fra, doTests, maxlike=FALSE)
jointTestP <- 1 - pchisq(jointTest$testresOverall, nDummies)
- if (! condition) {
+ if (! condition)
+ {
individualTest <- jointTest$testresulto[1:nDummies]
- } else {
- individualTest <- sapply(1:nDummies, function (i)
- { doTests <- rep(FALSE, nEffects + nDummies)
- doTests[nDummies+i] <- TRUE
- test <- ScoreTest(nTotalEffects, D, sigma, fra, doTests, FALSE)
- test$testresulto[1]
- })
}
+ else
+ {
+ individualTest <-
+ sapply(1:nDummies, function (i)
+ {
+ doTests <- rep(FALSE, nEffects + nDummies)
+ doTests[nDummies+i] <- TRUE
+ test <- ScoreTest(nTotalEffects, D, sigma, fra, doTests,
+ FALSE)
+ test$testresulto[1]
+ }
+ )
+ }
individualTestP <- 2 * (1-pnorm(abs(individualTest))[1:nDummies])
rownames(jointTestP) <- c("Joint Significant Test")
colnames(jointTestP) <- c("p-Val")
- thetaOneStep <- c(sienaFit$theta[-c(dscreen,rscreen,escreen)], rep(0, nDummies)) +
+ thetaOneStep <- c(sienaFit$theta[topleft], rep(0, nDummies)) +
jointTest$oneStep
- effectTest <- sapply(1:length(indBaseEffects), function (i)
- {
- doTests <- rep(FALSE, nEffects + nDummies)
- tmp <- which(dummyProps$shortName ==
- sienaFit$effects[-escreen,]$shortName[i] &
- dummyProps$interaction1 ==
- sienaFit$effects[-escreen,]$interaction1[i])
- if (length(tmp) > 0)
- {
- doTests[tmp] <- TRUE
- test <- ScoreTest(nTotalEffects, D, sigma, fra,
- doTests, FALSE)
- test$testresOverall
- }
- else
- {
- NA
- }
- })
+ effectTest <-
+ sapply(1:nBaseEffects, function (i)
+ {
+ doTests <- rep(FALSE, nEffects + nDummies)
+ tmp <- which(dummyProps$shortName ==
+ fitEffects$shortName[indBaseEffects][i] &
+ dummyProps$interaction1 ==
+ fitEffects$interaction1[indBaseEffects][i])
+ if (length(tmp) > 0)
+ {
+ doTests[tmp] <- TRUE
+ test <- ScoreTest(nTotalEffects, D, sigma, fra,
+ doTests, FALSE)
+ test$testresOverall
+ }
+ else
+ {
+ NA
+ }
+ }
+ )
- dim(effectTest) <- c(length(indBaseEffects), 1)
+ dim(effectTest) <- c(nBaseEffects, 1)
effectTestP <- round(1 - pchisq(effectTest, apply(toTest, 1, sum)), 5)
rownames(effectTestP) <- baseNames
colnames(effectTestP) <- c("p-Val")
- thetaStar <- cbind(c(sienaFit$theta[-c(dscreen,rscreen,escreen)], rep(0, nDummies)),
- thetaOneStep,
- round(c(2-2 * pnorm(abs(sienaFit$theta[-c(dscreen,rscreen,escreen)]/
- sqrt(diag(sienaFit$covtheta)[-c(dscreen,
- rscreen,escreen)]))),
- individualTestP), 5))
+ thetaStar <-
+ cbind(c(sienaFit$theta[topleft], rep(0, nDummies)),
+ thetaOneStep,
+ round(c(2-2 *
+ pnorm(abs(sienaFit$theta[topleft]/
+ sqrt(diag(sienaFit$covtheta)[topleft]))),
+ individualTestP), 5))
colnames(thetaStar) <- c("Initial Est.", "One Step Est.", "p-Value")
rownames(thetaStar) <- dimnames(G)[[3]]
returnObj <- list(
@@ -250,19 +260,21 @@
IndividualTestStatistics=individualTest,
CovDummyEst=jointTest$covMatrix,
Moments=G,
- NonRateIndices=indBaseEffects,
+ NonRateIndices=match(which(indBaseEffects),
+ which(topleft)),
Waves=dim(G)[2],
Sims=dim(G)[1],
Effects=dim(G)[3],
DummyIndexByEffect=dummyByEffect,
DummyStdErr=sqrt(diag(jointTest$covMatrix)),
OriginalEffects=nEffects,
- OriginalThetaStderr=sqrt(diag(sienaFit$covtheta))[-c(dscreen,
- rscreen,escreen)],
- SienaFit=sienaFit,
+ OriginalThetaStderr=
+ sqrt(diag(sienaFit$covtheta))[topleft],
+ #SienaFit=sienaFit,
DummyProps=dummyProps,
ToTest=toTest,
- ScreenedEffects=setdiff(c(rscreen,escreen),99999)
+ ScreenedEffects=which(!use),
+ WaveNumbers=periodNos
)
class(returnObj) <- "sienaTimeTest"
returnObj
@@ -297,9 +309,10 @@
}
tmp <- paste(" (", 1:length(rownames(x$IndividualTest)), ") ",
rownames(x$IndividualTest), "\n", sep="")
- cat("\nUse the following indices for plotting:\n", tmp)
+# cat("\nUse the following indices for plotting:\n", tmp)
tmp <- paste(" (", 1:length(x$NonRateIndices), ") ",
rownames(x$IndividualTest)[x$NonRateIndices], "\n", sep="")
+ cat("\n2. Use the following indices for plotting:\n", tmp)
cat("\nIf you would like to fit time dummies to your model, use the
timeDummy column in your effects object.")
cat("\nType \"?sienaTimeTest\" for more information on this output.\n")
@@ -353,7 +366,7 @@
{
stop("Effects is not a vector of integers.")
}
- x <- timetest$Moments[, , effects]
+ x <- timetest$Moments[, , effects, drop=FALSE]
}
panel.cor <- function(x, y, digits=2, prefix="", cex.cor, ...)
{
@@ -440,6 +453,8 @@
sub=paste("p=", timetest$EffectTest[effects[i]]), bty="n",
xlab="Wave", ylab="Parameter Value", auto.key=TRUE,
ylim=c(ymin, ymax), xlim=c(0, length(xaxis) + 1),
+ scales=list(x=list(labels=c(" ",
+ timetest$WaveNumbers, " "))),
panel=function(x, y){
for (j in 1:length(x))
{
Modified: pkg/RSiena/R/simstatsc.r
===================================================================
--- pkg/RSiena/R/simstatsc.r 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/R/simstatsc.r 2010-11-07 12:38:33 UTC (rev 125)
@@ -1622,6 +1622,7 @@
attr(f, "compositionChange") <- attr(data, "compositionChange")
attr(f, "exooptions") <- attr(data, "exooptions")
attr(f, "groupPeriods") <- attr(data, "groupPeriods")
+ attr(f, "periodNos") <- attr(data, "periodNos")
# attr(f, "totalMissings") <- attr(data, "totalMissings")
if (x$maxlike && x$FinDiff.method)
Modified: pkg/RSiena/changeLog
===================================================================
--- pkg/RSiena/changeLog 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/changeLog 2010-11-07 12:38:33 UTC (rev 125)
@@ -1,3 +1,39 @@
+2010-11-06 R-forge revision 125
+
+ * data/allEffects.csv,
+ src/model/effects/InStructuralEquivalenceEffect.cpp,
+ src/model/effects/InStructuralEquivalenceEffect.h,
+ src/model/effects/EffectFactory.cpp,src/model/effects/AllEffects.h,
+ src/data/OneModeNetworkLongitudinalData.cpp,
+ src/data/OneModeNetworkLongitudinalData.h,
+ R/sienadataCreate.r, R/initializeFRAN.r, src/siena07internals.cpp:
+ new in-structural equivalence effect (RSienaTest only)
+ * data/allEffects.csv, R/sienaModelCreate.r, R/initializeFRAN.r,
+ R/sienaprint.r, man/sienaModelCreate.Rd, R/printDataReport.r,
+ src/model/variables/NetworkVariable.cpp,
+ src/model/variables/NetworkVariable.h,
+ src/model/variables/DependentVariable.cpp,
+ src/model/variables/DependentVariable.h,
+ src/model/variables/BehaviorVariable.cpp,
+ src/model/EpochSimulation.cpp, src/model/Model.h,
+ doc/simstats0c.tex: symmetric models
+ (RSienaTest only)
+ * R/robmon.r, man/siena01Gui.Rd : minor textual corrections
+ * R/sienaDataCreate.r: sorted networks before behavior variables
+ * doc/RSienaDeveloper.tex, doc/Siena_algorithms4.tex:
+ documentation (RSienaTest only)
+ * R/phase1.r: do finite difference calculations for fixed
+ parameters during phase 3.
+ * R/print07Report.r, R/phase3.r: fix typos in printing of report.
+ * R/sienaTimeTest.r: fix bugs with missing interaction effects,
+ multiple dependent networks and multiple groups.
+ * src/model/effects/DenseTriadsEffect.cpp: add parentheses to remove a
+ compiler warning.
+ * src/model/ml/MLSimulation.cpp: commented a problem (RSienaTest only)
+ * src/siena07models.cpp: return chains as dataframe not list.
+ (RSienaTest only)
+ * cleanup.win: remove siena01.exe part
+
2010-10-22 R-forge revision 124
* R/sienaTimeTest.r: fix bug causing error when only one effect
Modified: pkg/RSiena/cleanup.win
===================================================================
--- pkg/RSiena/cleanup.win 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/cleanup.win 2010-11-07 12:38:33 UTC (rev 125)
@@ -1,3 +1,3 @@
rm -f src/*/*.o
rm -f src/*/*/*.o
-cd src/win32; make clean
+rm -f src/RSiena.dll
\ No newline at end of file
Modified: pkg/RSiena/inst/doc/s_man400.pdf
===================================================================
--- pkg/RSiena/inst/doc/s_man400.pdf 2010-10-22 21:43:03 UTC (rev 124)
+++ pkg/RSiena/inst/doc/s_man400.pdf 2010-11-07 12:38:33 UTC (rev 125)
@@ -498,35 +498,40 @@
332 0 obj
(Changes compared to earlier versions)
endobj
-337 0 obj <<
-/Length 1111
+333 0 obj
+<< /S /GoTo /D (appendix.C) >>
+endobj
+336 0 obj
+(References)
+endobj
+346 0 obj <<
+/Length 1140
/Filter /FlateDecode
>>
stream
-xÚVÛnã6}÷Wè"7ñÒ>,²»Ùv$Û&îS·²ÍØjtI%9Yÿ}É(Däs83çiìü²`ï|?®_¸N¢Æ¬.N%;*¸MVÛä/r×K¡É!/©d<4íòïÕoàkf¾\SÍ@G¯û¯×·WþÙFPOÛ´o»¢©]Q6xÙÄQ§
N©Ôr¤S7ö{»Ì8ià£Ë,y`K0×æìåi®¨TZD at EÔg©uñîý@ ¾ÜO¥?ÎÆoZ J!aµ´4:_Ñáîëâ-Äu#´²#ã
-)yJKu!òu¥2±T}ºyÀï·@Ëö§eªdF>û§¼í+_ýt£!÷}ÞútËÃ'Ŧûnß׾ܢǧ¦,ýÎÏ@gcá27¤ýmÓ7ëeÃC_!.S0ÎΦ}½Zp°'ÜdT3H&©V:ÙT2.âÿhwË/O>7?àï-ö¸5Ó t½tqi*.,§ËDpFí «u×·ù¦2Å&þ)×ÚÂá8è·
- íì4ªõÿeìÔP3T6;µSQJ`Ûįõ³ïúb71=4KaIëê©h
-ö¬#·DãÈKØÑQûWÐ8Ç®èÎÊUÓ@9ºÀæøÍáÃÙ4ÕÓtÔGîÁðÔ6»6¯pS¿Ïc
-A0¥Ê¹ oкCÔMÞ¶
Zö´ª8y´tA¬&æs5æ\Уj@~l}9`
αüsL¾<7[ã2ÀIÀM1TO+Ö>°ùfmVÔ»'Ótn8ÛcWÅ' ¦¦MH·À½ß¢½Â!tCDÈÅT¢\ÃÕ¥G.>|8CWÐ<Ñ×Ûs0@8iêJF×áöë¬öq70?M°Êc.ø48GÞQ24rúÌË0×£ÊLÃ@À«*¦êÃ@¨¥ôÛ3(Eã w÷@E~.M³×
-ÎÈËöxF,
f±  HXìÛb}@faí)ËÌ|çÑØA¾¯ñîØõ¾:¾ò×¼;K3úÜj<hF¦ÕÇGó¹×y³0ÄV3c#h¤¼-Øì` âñ$£ÿi&"p¯¿ [6òuE
-@yQwËHJ¯^Xyi¾÷õ,Þp{ÃÛÉ7M.°Tª×Tc0_ÙÇ7y¼P$¿v^àì&<µ¨Ü~÷ÆÛÅ1ðu¼|»óínÄ$åÓ¾
-Éë ÷»rP#}ó+gú£ÛÂû¤:ËqÌÏàþ}Â
+xÚVÝs£6÷_Á#ÌIö)w´×¤mâ>ÝõcÙ¦áÃìÔÿ}wµà3.i§ã#vû½Räm½Èûa½óý°\Ü>ðÄ1ÓFso¹ñ¸L¦±§yÊ7Þrí}ñ³:ÈÊ ð7Mü¾ü dõD',á)@;©Ï÷OwßD,IÎlG¶mW45¡Ç,¤²4
+
dÇ^(8KGÃ~iÅýæX ´³Nÿ`k9;{û µÇc&ãD8À a&÷|èw =2üjÿ¹Øö4¿^h"&
$e`ßT$|Ç>0{©?Ö`×,Yn)Eñ)¹JÃ¥ù·ºPiª'n6ôýù/HËú» ¥ò?Ù}Öö±¿dÔþKõ.9q¿È»ïéèéð5â-×$ñ±)K»µ£ÁPÍ¡À©tpû©AEd_ã¯ÐÙJ¸ê EÄ£ÙÜ/Ç=®K"íÉH3¦^^-þ\HwHÿ0rÛ{ůð»ÆYÃ9¼v- SÏ@¡%1F_Î$T?ãà§óïnÕõm÷ïä/. Bhè!Ð-rÝ
+ÒLÔ±DÇc3|Ttî® *D]uî¢:FêÔÿ\m×ÛÒ¦Á<´´¹¯öE[äÔÀ©ÿd¡Rÿ
+9\µ¯tp]tênÎP.X|i('`vß><òó¦Ú ¨z{ ìÛfÛf1õ»ÌŪGC Ø¡ðSBͳ¶-,&п,ÜD%Jn@@«ÑgÙDÕ@ùmËc:ŲGç|y i0·¦c Múy1jª/#Ö¾°YCÏõÖùMéCJ=¨ÅúTgUÓ©iÃܸ·k¢W¤L§=X4i¿/:;O3¬¡+:4^įi7sÂÀ¨®\£Ñõú_q;ÛÌ%ûæé90=c¥üå*ò:®ô´"¬!xxQá¢ýGÜl;iÉ"Îg®ªiÍÃ%h.o*C7ÕP0 :ÆÉfÐY,Ô ÅYÚõJ£YlF¬çH|6§2aêÛ<Ðßv8°sÔ¿#½äºv]Û¼q÷m±ÆUÐ÷z
+²rk5ß"Gíw·TñßázöýîÔõ0ßg ¯q¶úyÆ/ÅR}7#¸¥ËP·tÈ8ï¾Ê:ç \÷elÖºc®1ÿÎMáè?§²áÿÈ;=*ºt7qáìràB)#a¢¯&[CmuWcr2A#ù-úfÛ¸±
77ÝêÒMܯäDëÇç8®~<pÞàLýÇJ+À:9èÙavç¡f»rÓǶ[ÛÂCÏ_÷ÞÇ]¥a<b
+»-5ìêÝuùãF1xxaªàù5ÔÙt4Á[àoÛW¤L
endstream
endobj
-336 0 obj <<
+345 0 obj <<
/Type /Page
-/Contents 337 0 R
-/Resources 335 0 R
+/Contents 346 0 R
+/Resources 344 0 R
/MediaBox [0 0 595.276 841.89]
-/Parent 348 0 R
+/Parent 357 0 R
+/Annots [ 339 0 R 340 0 R 341 0 R 342 0 R 343 0 R ]
>> endobj
-334 0 obj <<
+338 0 obj <<
/Type /XObject
/Subtype /Form
/BBox [0 0 84 59.04]
/FormType 1
/Matrix [1 0 0 1 0 0]
-/Resources 349 0 R
+/Resources 358 0 R
/Length 34
/Filter /FlateDecode
>>
@@ -534,7 +539,7 @@
xÚ+ä²0Q0 BSK=+9Kß3×PÁ%+ hÆ
endstream
endobj
-333 0 obj <<
+337 0 obj <<
/Type /XObject
/Subtype /Image
/Width 350
@@ -646,781 +651,978 @@
klÇ,TÄñéïöw¬u?ÜèéÒÃ$V¾gedc#ýsÏqELè¯N)FËìkñöñýÄrF|¤ùWýcm1çzyÅvZÝ´X®`iPIGä½*¤là}VU7Fî`i¾ñ^u}®A«X%õÖöiCîÁ,3ù*í£I.PÜ^E[`Ês³»oÖ*»ÔâÄI·qñ¨@¢ghÔgcÅçýìdþ5*Ìåc0)9#~pqôQV`N$UB6½qÛZS~(wF¢dûhôoÒíýÖý(¢}´z7ä(ûhôoÈQE 'ÛÇ£þuêI[¶¹ö¢C3ï5HX"û!Ï®<}«4ÛyÁÄÜ8'îqÀíùQEsÔoî¥N=Íã-ý"m*iå%ie{¢ÄáGÞ8ëÛëX?¼Wq{cc XãÍãa^I8áOOJ(¬èÉËçM*qU£dqÖÄÒͪê3©cgå³][-²0ùæ<üñSiz§¨É#¶.»9;Xgv aÎ3}I'©4Q]5"¹Né¥ïoí®´é}2Jó¡d1ðëVà$§å⡳Ôtý:Ú(Öå¯×yâ;£Ë={òxêh¢¢ÊÖ#x»5(gÕÑä®ùÃKµåsÐç?tÃãSH¼©DQÉ×÷iF9ùØ»ºzE,«'1óx¾¶µ¤Ë$!o>uPOUè½°?Ö3OÞÝ´H
UP3
àsù÷¢å¨5c ll®§g Ö Ilc!Kc Øé¥áfW(Ós¾@z{ô¢êVÇö¹ÿÙ
endstream
endobj
-349 0 obj <<
-/XObject << /Im1 333 0 R >>
+358 0 obj <<
+/XObject << /Im1 337 0 R >>
/ProcSet [ /PDF /ImageC ]
>> endobj
-338 0 obj <<
-/D [336 0 R /XYZ 88.008 808.885 null]
->> endobj
339 0 obj <<
-/D [336 0 R /XYZ 89.008 771.024 null]
+/Type /Annot
+/Subtype /Link
+/Border[0 0 0]/H/I/C[0 1 0]
+/Rect [273.946 177.414 308.012 188.372]
+/A << /S /GoTo /D (cite.Snijders01) >>
>> endobj
-335 0 obj <<
-/Font << /F16 340 0 R /F17 341 0 R /F18 342 0 R /F37 343 0 R /F39 344 0 R /F40 345 0 R /F38 346 0 R /F8 347 0 R >>
-/XObject << /Fm1 334 0 R >>
+340 0 obj <<
+/Type /Annot
+/Subtype /Link
+/Border[0 0 0]/H/I/C[0 1 0]
+/Rect [312.625 177.414 333.049 188.372]
+/A << /S /GoTo /D (cite.Snijders01) >>
+>> endobj
+341 0 obj <<
+/Type /Annot
+/Subtype /Link
+/Border[0 0 0]/H/I/C[0 1 0]
+/Rect [336.638 177.414 357.061 188.372]
+/A << /S /GoTo /D (cite.Snijders05) >>
+>> endobj
+342 0 obj <<
+/Type /Annot
+/Subtype /Link
+/Border[0 0 0]/H/I/C[0 1 0]
+/Rect [379.544 177.414 437.065 188.372]
+/A << /S /GoTo /D (cite.SnijdersEA07) >>
+>> endobj
+343 0 obj <<
+/Type /Annot
+/Subtype /Link
+/Border[0 0 0]/H/I/C[0 1 0]
+/Rect [441.678 177.414 462.102 188.372]
+/A << /S /GoTo /D (cite.SnijdersEA07) >>
+>> endobj
+347 0 obj <<
+/D [345 0 R /XYZ 88.008 808.885 null]
+>> endobj
+348 0 obj <<
+/D [345 0 R /XYZ 89.008 771.024 null]
+>> endobj
+344 0 obj <<
+/Font << /F16 349 0 R /F17 350 0 R /F18 351 0 R /F37 352 0 R /F39 353 0 R /F40 354 0 R /F38 355 0 R /F8 356 0 R >>
+/XObject << /Fm1 338 0 R >>
/ProcSet [ /PDF /Text ]
>> endobj
-403 0 obj <<
+415 0 obj <<
/Length 2110
/Filter /FlateDecode
>>
stream
-xÚí[K8ÞçWx7xa¢7RïjJNÍéLÏIUY¤{A at esÂÃ# ©üûmÀU8]îJyeï>¿{¯Áb½ ·/ûüçÍo\@bÂÐâævÁE _DÁÅMºø¼ªÊ%A#íG½üýæ_~o°XðP0FÌõ`±B äÚKár%(ÞÊRª8_®° AVÞVªLo»¿Ó@rôîZ<¸yP
-J»]õ«WL`{ÍÕr!¢Á»¬Ìî
-®ìs«êðvVÁòðûÀØýQÿ>Mkû>u«F¦æ
-¾dÍÆì§ìm! ý«]_]þûâ¾ÛbÀBÂy¿~ô|oíèÅÅ
+xÚí[MÛ¸½ûWèê ßö6±Ç.§ÖÙg¶rpr IÄ2?´Çÿ> BIÍPÎÄ»cé$Aò= »_w,Ö°xû¸Ï¿Þ¾xùÀ$!&-nï\ ðEÄ`\ܦÁ«ª\b4Ò~ÔËßþÍÏñò
+
+ƹ,VQ{)\®Á[YJçË$ÈÊ»Jqéi÷gZ(B.þÑ]K÷1
+CAi÷ «~ô
+à l¯y·\Ahð>+³¢»aDwö¹Uux»+Äà}ü}`Dìü¨¦Éʵ}ºU#Só_³fcæÓö¦þÕnÞ]ÿýê¡ÛbÀBÂy?~ô|oìèÁÅ
pOjì! P¿¾~Â<ù
-Äej¿¨¶,³R[ÛßÍFÚ/ko7Yb.Ëí¶Ê~Ó ¡BÝÆ[Þ©=ÿfeZ_ê!⣠\®($§~àn ØüY0D
-9¤~Põ;`Èíñ{1¸UUa½{¨rüló ½>(ÆüÑ0xÔëR!:Pì }oK+PùÍÊõÓrEhÈT6qsô]Pù+Ð$ÍˬÇóuÜGÛóÞ̾ë;>Íë¦)ú_ÖC>å=ïT¥µ¿Þ ñ¤3v4læÀ~í<@çª[êÍÆùÎ$,öÖ\ÔWûó:QR#÷a¿ö¨Ý¾\pÄñ Þw½íTTà3åÂ\LvnôÜÍ6ø HëFéöà3S!f
-@dãD!%üÜ鯧<dåÄVzúUïï#P,õêç¿IÔ+ÁB 8÷ï(XðfÉ©OíMU»pÿeSÙc±rGê<[o:ûÌ]º,Ïbwñ1¾(tù<ÃDì üI CÉÈö:Îv(nÛÜ"¤ê¸×g#©ê¸ûÕÜ?´yøÁèÇ2¹©ÀtLDEÚ±±°Ñ
Ë|å]\ls97!Û~ÞO8JâÔʶs/ûµ¯É³s5!/¢ì p@M%À1A qè
-qüÒ6yVÊüy/9èoö`ÚN¶J²eon`àGs³3-è{%¥¢+ åMfl` v]ËQ>MÑÄÄÜ,
-"+ëFnkÏ_¬òç~T¼ß]XP²Öª]õéòN&m3åÁHb&z4`//V¢£èé³Êûä¢9
-â#ñ`+·Ùgo(JÞJ%ËdlÒs2û-a¹æB<vÑo]kÒ¥Þw}Ìe1®LWølN ~ÔÍ:ÍExÔÌÂз´~¥úGm;ZEܵ´Ú89J"`8§§Eû>[×Óêë]Ok«Ó§zØ#!å>ÏÜÂôãìù~±{_Û¶±;§¦tïÆèf#6 Ä7»^g]kÁõ
-|-ð7 I>ö'HDÏJK¥HÕ©5ö'PÐp<q¾nT4󧲪Ðyijeöy©n·cañç`b|,~N"Ûw._5ä6N3×vLºþ«ÅReq3F0~n
-}Kè*ó^6Ø÷ßSܤí^³óañ0ÄÎ "o,ÄÄõQãÄ_Ç
-üDD:°¥FÅeíGV}'#ISZ¢ü¨¡aðTÊ4Àt&Ô7ã¶e*-¬H%»YÎÇ,(~ê]G
-¬sÐwCßeõ®Ä0N®4Àâì;þd«à$ÁD¾/WXÓ¨êlg±M\®åÑÚäókÙLYø©Ü2ÖmáÑýXt÷0QO{÷9#µñi¥~àÆFëm÷[&!sÉäüè!ä§IºìW5ñ~`«=qtý4X&Ën0v¿#R6ݤÉ*½@}ê2.²¤þÉ<ß$eªJ¹*lq2©Oãj1gm<Í£¨õTë/U½ëNUBÏ^ë´d¤ç{VðÍ°Û0ËØÈ]Ö\×V¨¡é°æêÉÆQÚÈû;Ggnê©Ú+UÕõªÆÌ»1V½½ÈÒú"?
-p¬¥kS=¸N*»Çõlñ·&lÍDNkg~´,nwõ(Ê϶æíÔøÇüÙMóMj5U¢³]¤iæfûhÖ$ú}lÚýpBæ¡5ü¾}eGöÑFÞdo°dà!Cõx¤R<ñ¡'E½îÞd
ì»
Øj-Kuï«×ðî³ÐoÇlj¯mcÓx¹p·Dì®&:Ó÷Tö笰¾cô_"¾Ën¸pA¯5S¹VrTm >ÓVøÄç0Sféåêÿ$ìtþÉ<ÿ¼È×2ÿ)i6£ÿPÂΩü£ëż¢óDð¶Ù¶]b:ÚeðsÑü¯eµÙÎî¼ËìâÍd°áTíƹ¦áDz/Ú¦2>2ÙÍ_Üù6Eß<;.ÊÀ߸<Ö~úUU¦]7¡ç
-®k¶Lçìloÿ·ï!¯üɺù¸Û{ù¿6S}EeשÜØTà; îbì/§P0+Á4¦2Me®@±Jm]*U©ûǾ·|ù/¾bÝ !NnpHû1¶Ã
-ÅåÍ? G¹ò
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/rsiena -r 125
More information about the Rsiena-commits
mailing list