test_parameter: Wald and score tests for RSiena results

View source: R/Sienatest.r

test_parameterR Documentation

Wald and score tests for RSiena results

Description

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.

Usage


## 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)

Arguments

x

An object of class sienaFit, resulting from a call to siena.

method

NULL, "all", "same", or "score".

tested

One number or a vector of numbers between 1 and p, where p = x$pp, the number of parameters in x excluding the basic rate parameters used for conditional estimation; these indicate the tested parameters. Can also be a logical vector of length p;
or, for test_parameter, a k * p matrix.

tested2

A single number or vector as mentioned for tested; these two parameters are tested for equality for method = "same".

A

A k * p matrix, where p = ans$pp, the number of parameters in ans excluding the basic rate parameters used for conditional estimation.

e1, e2

Each an integer number between 1 and p, or a vector of such numbers; the hypothesis tested is that the parameters for effects with number/s e1 are equal to those in e2.

...

Additional arguments (currently not used.)

Details

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.

Value

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 df=1, the onesided test statistic.

efnames:

For Multipar.RSiena and score.Test, the names of the tested effects.

Author(s)

Tom Snijders

References

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.

See Also

siena, print.sienaTest

Examples

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)

RSiena documentation built on April 20, 2026, 5:07 p.m.