| test_parameter | R Documentation |
These functions test parameters in RSiena results
estimated by siena.
Tests can be Wald-type (if the parameters were estimated)
or score-type tests (if the parameters were fixed and tested).
The function test_parameter chooses among the
functions Wald.RSiena, Multipar.RSiena,
testSame.RSiena, and score.Test,
based on the input given. The export of the latter three functions is superfluous,
but they are kept for backward compatibility.
## S3 method for class 'sienaFit'
test_parameter(x, method=NULL, tested=NULL, tested2=NULL, ...)
Wald.RSiena(A, x)
Multipar.RSiena(x, tested)
testSame.RSiena(x, e1, e2)
score.Test(x, tested=x$test)
x |
An object of class |
method |
|
tested |
One number or a vector of numbers between 1 and |
tested2 |
A single number or vector as mentioned for |
A |
A |
e1, e2 |
Each an integer number between 1 and |
... |
Additional arguments (currently not used.) |
The tests for test_parameter, Wald.RSiena,
Multipar.RSiena, and
testSame.RSiena are Wald-type tests
(but see below for test_parameter with method=score.
For test_parameter and Wald.RSiena,
if tested is a matrix A, the hypothesis tested
is A\theta = 0, where \theta is
the parameter estimated in the process leading to x.
For test_parameter and Multipar.RSiena
if tested is a number or vector, a multivariate
(i.e., simultaneous) test is given of the hypothesis that
the parameters mentioned in tested are 0.
For test_parameter if method="all",
a test is given of all parameters in the model.
For test_parameter
if method="same", the items "tested" and "tested2"
should be single numbers or vectors of equal length, and the test
of equality of the corresponding two parameters is given.
For test_parameter if method="score", and for score.Test,
the parameters with numbers in "tested"
should all be used in x as fixed-and-tested parameters,
and the multivariate score test of these parameters is given
of the hypothesis that the tested parameters have
the value indicated in the effects object used for obtaining x.
The numbering of parameters is as in print(x);
if conditional estimation was used, numbered
as the 'Other parameters').
These tests should be carried out only when convergence is adequate (overall maximum convergence ratio less than 0.25 and all t-ratios for convergence less than 0.1 in absolute value).
These functions have their own print method, see print.sienaTest.
An object of class sienaTest, which is a list with elements:
chisquare: |
The test statistic, assumed to have a chi-squared null distribution. |
df: |
The degrees of freedom. |
pvalue: |
The associated p-value. |
onesided: |
For |
efnames: |
For |
Tom Snijders
See the manual and https://www.stats.ox.ac.uk/~snijders/siena/
M. Schweinberger (2012). Statistical modeling of network panel data: Goodness-of-fit. British Journal of Statistical and Mathematical Psychology 65, 263–281.
siena, print.sienaTest
myalgo <- set_algorithm_saom(nsub=1, n3=40, seed=1777)
# nsub=1 and n3=40 is used here for having a brief computation,
# not for practice.
mynet <- as_dependent_rsiena(array(c(s501, s502), dim=c(50, 50, 2)))
mydata <- make_data_rsiena(mynet)
myeff <- make_specification(mydata)
myeff <- set_effect(myeff, list(transTrip, transTies))
myeff <- set_effect(myeff, list(outAct, outPop), fix=TRUE, test=TRUE)
(ans <- siena(mydata, effects=myeff, control_algo=myalgo, batch=TRUE))
A <- matrix(0, 2, 6)
A[1, 3] <- 1
A[2, 4] <- 1
(wa <- test_parameter(ans, tested=A))
wa
# An alternative specification of the above is:
test_parameter(ans, tested=c(3, 4))
# The following two are also equivalent:
sct <- test_parameter(ans, method="score",
tested=c(FALSE, FALSE, FALSE, FALSE, FALSE, TRUE))
sct <- test_parameter(ans, method="score", tested=6)
print(sct)
# Getting all 1-df score tests separately:
for (i in which(ans$test)){
sct <- test_parameter(ans, method="score", tested=i)
print(sct)}
# Testing that endowment and creation effects are identical:
myeff1 <- make_specification(mydata)
myeff1 <- set_effect(myeff1, list(transTrip, transTies))
myeff1 <- make_specification(mydata)
myeff1 <- set_effect(myeff1, recip, include=FALSE)
myeff1 <- set_effect(myeff1, recip, type='creation')
(myeff1 <- set_effect(myeff1, recip, type='endow'))
ans1 <- siena(mydata, effects=myeff1, control_algo=myalgo, batch=TRUE)
test_parameter(ans1, method="same", tested=2, tested2=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.