From Achim.Zeileis at wu-wien.ac.at  Tue Jul 28 19:23:44 2009
From: Achim.Zeileis at wu-wien.ac.at (Achim Zeileis)
Date: Tue, 28 Jul 2009 19:23:44 +0200 (CEST)
Subject: [Rd] How to use formulas for multivariate clustered data?
In-Reply-To: <20090728195844.60574ascdn9hdb28@imp2.uta.fi>
References: <20090728195844.60574ascdn9hdb28@imp2.uta.fi>
Message-ID: <Pine.LNX.4.64.0907281918110.25026@paninaro.stat-math.wu-wien.ac.at>

Klaus:

> I wrote already a couple of weeks ago but did not get any reply. Therefore 
> I'll rephrase my question and hope some of you can give me some answers or 
> some advice where better to look for an answer.
>
> In general I'm looking for information on how to program functions using 
> formulas in order to write a nonparametric multivariate regression function 
> with possible clustering of the data.
>
> I would assume that the formulas for my function would have the form
> y1 + y2 + y3 ~ x | z
> or
> Y ~ x | z,
>
> where y1, y2 and y3 are continuous response variables, or Y the matrix of 
> responses and x an explaining variable and z a factor indicating the cluster 
> membership.
>
> I'm looking for general information about writing functions using formulas. 
> But more concrete I would need to know what would be the best way to make 
> sure that the response should be multivariate and numeric? What is the best 
> way to define the hierarchical structure, is it the "|" or is there another, 
> better way? How can I restrict the number of hierarchical levels?
> And how to use in this context, the data, subset, weights and na.action
> arguments?

The CRAN package "Formula" has some functionality which might assist you 
in what you want to do. It provides several tools for extracting 
information from formulas like
   Y ~ x1 + x2 | z

The version on R-Forge also has some tools for
   y1 + y2 + y3 ~ x1 + x2 | z1 | z2 + z3
etc. But the version on R-Forge is not yet quite stable, however, we hope 
to get something new to CRAN over the summer.

The package just assists you with accessing the different parts of the 
formula. All the checking of types, dimensions, etc. you have to do 
yourself. I hope it solves some of your problems, though...

hth,
Z

> Thanks in advance,
>
> Klaus
>
> -- 
> Klaus Nordhausen
> Researcher
> Tampere School of Public Health
> FIN-33014 University of Tampere
>
> phone:	+358 3 3551 4153
> fax:	+358 3 3551 4150
> e-mail:	Klaus.Nordhausen at uta.fi
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] How to use formulas for multivariate clustered data?
Achim Zeileis