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), |
separate |
A logical value specifying whether variables should be demeaned separately for isolated and non-isolated individuals.
This is similar to setting |
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.