MakeWTable
サンプルに値が与えられているときに、サンプル数xカテゴリ数の表に重みづけをつけることとする。
カテゴリには0:(カテゴリ数-1)の順序を付けるものとして重みづけする
MakeWTable(g,k)
MakeWTable<-function(t,k=c(0,1)){
n<-length(k)
m<-matrix(0,n,length(t))
for(i in 1:n){
m[i,]<-t*k[i]
}
return(c(t(m)))
}
\name{MakeWTable}
\alias{MMakeWTable}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
MakeWTable
}
\description{
サンプルに値が与えられているときに、サンプル数xカテゴリ数の表に重みづけをつけることとする。
カテゴリには0:(カテゴリ数-1)の順序を付けるものとして重みづけする
}
\usage{
MakeWTable(g,k)
}
\arguments{
\item{g}{サンプル数の長さのベクトル}
\item{k}{カテゴリの重みづけベクトル}
}
%- maybe also 'usage' for other objects documented here.
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{
カテゴリ数xサンプル数であるようなベクトル
}
\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{
Ns<-20
k<-c(0,1)
g<-sample(c(0,1,2),Ns,replace=TRUE)
w<-MakeWTable(g,k)