[R] how to put constraint in R?

Spencer Graves spencer.graves at pdf.com
Thu Dec 22 18:36:26 CET 2005

	  What are you trying to do?

	  Suppose, for example, that you have a categorical variable 
representing 3 different age groups, and you want to estimate a linear 
model.  As long as R recognizes the variable as categorical (of class 
"factor" or "ordered factor", R handles this automatically using 
"contrasts".  If this is your question, I suggest you read about 
"factors", "Formulae for Statistical Models" and "Contrasts" in "An 
Introduction to R", which is the upper-left choice after 'help.start()' 
in recent versions of R (or downloadable from www.r-project.org -> 
Documentation -> Manuals).

	  If you would like more help from this group, I believe you will 
increase your chances of getting quickly the information you seek in you 
PLEASE do read the posting guide! "www.R-project.org/posting-guide.html".

	  hope this helps.
	  spencer graves

Oana Mocila wrote:

> Dear all,
> I have a problem when I was working on Age-Period-Cohort study in R. I tried 
> to put constraint to
> two coefficients on age (so that to solve the identification problem due to 
> linear dependency). But
> I don't know how to do this in R(put constraint). If you could give me some 
> suggestion, it will be very helpful!
> Oana
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915

More information about the R-help mailing list