Learn R Programming

lestat (version 1.9)

designManyGroups: Create a Design Matrix for Several Groups of Normal Observations

Description

A design matrix is created, to be used for the analysis of data assumed to come from several normal distributions.

Usage

designManyGroups(v)

Arguments

v

A vector of integers, indicating how many observations there are in each group.

Value

A matrix consisting of 0's and 1's. The number of columns is equal to the length of v. The number of rows is equal to the sum of teh values of v.

See Also

designOneGroup, designTwoGroups, designBalanced, designFactorial

Examples

Run this code
# NOT RUN {
data1 <- simulate(normal(3.3, log(2)), 9)
data2 <- simulate(normal(4.5, log(2)), 8)
data3 <- simulate(normal(2.9, log(2)), 7)
design <- designManyGroups(c(9,8,7))
posterior <- linearmodel(c(data1, data2, data3), design)
plot(posterior)
# }

Run the code above in your browser using DataLab