Learn R Programming

NlsyLinks (version 1.003)

CreateSpatialNeighbours: Distances between related family members, formated for spatial analysis.

Description

This helper function formats the LinksPair datasets so it can be used in some types of spatial analyses. The spdep (Spatial Dependence) uses a sparse matrix (actually a data.frame) to represent neigbours.

Usage

CreateSpatialNeighbours(linksPairsDoubleEntered)
CreateSpatialNeighbours79Gen2()

Arguments

linksPairsDoubleEntered
## Need something here. ##

Value

  • Returns an S3 spatial.neighbours object to work with functions in the spdep package. Subject1Tag is renamed from. Subject2Tag is renamed to. R is renamed weight. The attribute region.id specifies each unique SubjectTag. The attribue n specifies the number of unique subjects.

Details

There is one row per unique pair of subjects, respecting order. This is different than Links79Pair and Links79PairExpanded, which has one row per unique pair of subjects, irrespective of order. CreateSpatialNeighbours79Gen2 automatically creates dataset of NLSY79 Gen2 subjects (i.e., the children of the mothers in the initial NLSY79 sample. CreateSpatialNeighbours accepts any paired relationships in a data.frame, as long as it contains the columns Subject1Tag, Subject2Tag, and R. See Links79Pair for more details.

References

Bivand, R., Pebesma, E., & Gomez-Rubio, V. (2008). Applied Spatial Data Analysis with R. New York: Springer. (Especially Chapter 9.) ##David, can you please give me some of the articles/books that you used this with?

See Also

Links79Pair listw2sn, sn2listw, df2sn, write.sn2gwt, write.sn2dat are some of the functions in the spdep package that use a spatial.neighbours object.

Examples

Run this code
#Need something here

Run the code above in your browser using DataLab