makeDiffMatrix
差分表を作る
makeDiffMatrix(N,M,c)
makeDiffMatrix <-
function (N, M, c = 1)
{
library(MCMCpack)
testm <- matrix(rdirichlet(1, rep(1, N * M)), nrow = N) * c
testm <- testm - sum(testm)/(N * M)
m1 <- apply(testm, 1, sum)/M
m2 <- apply(testm, 2, sum)/N
testm <- testm - m1
testm <- t(t(testm) - m2)
testm
}
\name{makeDiffMatrix}
\alias{makeDiffMatrix}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
makeDiffMatrix
}
\description{
差分表を作る
}
\usage{
tableExpAndMarginals(O)
}
%- maybe also 'usage' for other objects documented here.
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{
NxM行列
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%% ~~who you are~~
}
\note{
%% ~~further notes~~
}
%% ~Make other sections like Warning with \section{Warning }{....} ~
\seealso{
}
\examples{
N<-3
M<-4
makeDiffMatrix(N,M,c=1)
}