Abstract
The RĀ language has several built-in matrix algebra commands. This proves useful for analysts who wish to write their own estimators or have other problems in linear algebra that they wish to compute using software. In some instances, it is easier to apply a formula for predictions, standard errors, or some other quantity directly rather than searching for a canned program to compute the quantity, if one exists. Matrix algebra makes it straightforward to compute these quantities yourself. This chapter introduces the syntax and available commands for conducting matrix algebra in R.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Alternatively, when the combined elements are complex objects, c instead creates a list object.
- 2.
For readers interested in bootstrapping, which is one of the most common applications of sampling from data, the most efficient approach will be to install the boot package and try some of the examples that library offers.
- 3.
An alternate syntax would have been X2%o%X3.
- 4.
A unique variety of matrix multiplication is called the Kronecker product (H āL). The Kronecker product has useful applications in the analysis of panel data. See the kronecker command in RĀ for more information.
- 5.
As another application in statistics, the likelihood function for a multivariate normal distribution also calls on the determinant of the covariance matrix.
References
Monogan JE III (2013a) A case for registering studies of political outcomes: an application in the 2010 House elections. Polit Anal 21(1):21ā37
Author information
Authors and Affiliations
10.1 Electronic Supplementary material
Rights and permissions
Copyright information
Ā© 2015 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Monogan, J.E. (2015). Linear Algebra with Programming Applications. In: Political Analysis Using R. Use R!. Springer, Cham. https://doi.org/10.1007/978-3-319-23446-5_10
Download citation
DOI: https://doi.org/10.1007/978-3-319-23446-5_10
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-23445-8
Online ISBN: 978-3-319-23446-5
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)