invmat | R Documentation |
Calculates the Moore-Penrose pseudoinverse of a square matrix X.
invmat(X)
X |
A square matrix. |
This function is used by default in R package netmeta to
calculate the Moore-Penrose pseudoinverse L^+
of the
Laplacian matrix L (Rücker, 2012):
L^+
= (X - J / n)^{-1}
+ J / n
with identity matrix J of dimension nxn.
The Moore-Penrose pseudoinverse for matrix X.
Gerta Rücker gerta.ruecker@uniklinik-freiburg.de, Guido Schwarzer guido.schwarzer@uniklinik-freiburg.de
Rücker G (2012): Network meta-analysis, electrical networks and graph theory. Research Synthesis Methods, 3, 312–24
netmeta
, solve
data(smokingcessation)
p1 <- pairwise(list(treat1, treat2, treat3),
event = list(event1, event2, event3), n = list(n1, n2, n3),
data = smokingcessation, sm = "OR")
net1 <- netmeta(p1)
invmat(net1$L.matrix.common)
## Not run:
data(Senn2013)
net2 <- netmeta(TE, seTE, treat1.long, treat2.long, studlab,
data = Senn2013)
L1 <- net2$L.matrix.common
L2 <- invmat(net2$Lplus.matrix.common)
all.equal(round(L1, 10), round(L2, 10))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.