Hello, 

I want to create a design matrix using R. Can you explain the code which 
creates the following please? I understand the first part. 
b=g1(?) does what? 

dd <- data.frame(a = gl(3,4), b = gl(4,1,12)) # balanced 2-way 
dd 
a b 
1 1 1 
2 1 2 
3 1 3 
4 1 4 
5 2 1 
6 2 2 
7 2 3 
8 2 4 
9 3 1 
10 3 2 
11 3 3 
12 3 4 

I am using the tree dataset in R. I want to form a reparameterized design 
matrix in ones, zeroes and minus ones. The dataframe dd is very important here. 

Can anyone assist here? Thanks in advance. 

Mary A. Marion 




        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to