demean {QuantilePeer}R Documentation

Demeaning Variables

Description

demean demeans variables by subtracting the within-subnetwork average. In each subnetwork, this transformation can be performed separately for isolated and non-isolated nodes.

Usage

demean(X, Glist, separate = FALSE, drop = NULL)

Arguments

X

A matrix or vector to demean.

Glist

The adjacency matrix. For networks consisting of multiple subnets (e.g., schools), Glist must be a list of subnets, with the m-th element being an n_m \times n_m adjacency matrix, where n_m is the number of nodes in the m-th subnet.

separate

A logical value specifying whether variables should be demeaned separately for isolated and non-isolated individuals. This is similar to setting fixed.effects = "separate" in qpeer.

drop

A logical vector of the same length as the sample, indicating whether an observation should be dropped. This can be used, for example, to remove false isolates or to estimate the model only on non-isolated agents. These observations cannot be directly removed from the network by the user, as they may still be connected to other agents.

Value

A matrix or vector with the same dimensions as X, containing the demeaned values.


[Package QuantilePeer version 0.0.1 Index]