[R] gss package - predict.ssanova
José Ernesto Jardim
ernesto at ipimar.pt
Tue May 8 18:33:49 CEST 2001
Chong Gu wrote:
> Sender: ernesto at neptuno.ipimar.pt
> Date: Tue, 08 May 2001 09:51:08 +0100
> From: =?iso-8859-1?Q?Jos=E9?= Ernesto Jardim <ernesto at ipimar.pt>
> Organization: IPIMAR
> X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.14 i686)
> X-Accept-Language: en
> MIME-Version: 1.0
> CC: R-help at stat.math.ethz.ch
> References: <200105071639.LAA88280 at odds.stat.purdue.edu>
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Chong Gu wrote:
>
> > Here is the information about this objects.
> >
> > > recs.spliney
> >
> > Call:
> > ssanova(formula = recs.mds[[1]][, 2] ~ recs.loc$x * recs.loc$y, type = "tp")
> >
> > Terms:
> > [1] "1" "recs.loc$x" "recs.loc$y"
> > [4] "recs.loc$x:recs.loc$y"
> >
> > Number of fixed and random effects:
> >
> > Fixed Random
> > 1 1 0
> > recs.loc$x 1 1
> > recs.loc$y 1 1
> > recs.loc$x:recs.loc$y 1 3
> > total 4 5
> >
> > Smoothing parameters are selected by GCV.
> >
> > > is.data.frame(recn.grid)
> > [1] TRUE
> > > names(recn.grid)
> > [1] "x" "y"
> >
> > Regards
> >
> > EJ
> >
> > The variables in the fit are "recs.loc$x" and "recs.loc$y", but the
> > variables in recn.grid are "x" and "y".
> >
> > BTW, are recs.loc$x and recs.loc$y the x-y coordinate of geographic
> > locations? If the answer is yes, then you probably want to enter it
> > as a single variable with two columns. What you are now doing appears
> > to fit a tensor product spline.
> >
> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> > Send "info", "help", or "[un]subscribe"
> > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
> > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>
> Hi
>
> I've tried your proposal and I got an error message
>
> > ssanova(recn.mds[[1]][,1]~recn.loc,"tp")
> Error in model.frame(formula, rownames, variables, varnames, extras, extranames, :
> invalid variable type
>
> The objects are in aggreement with your description
>
> > is.data.frame(recn.loc)
> [1] TRUE
> > is.vector(recn.mds[[1]][,1])
> [1] TRUE
> > names(recn.loc)
> [1] "x" "y"
>
> Regards
>
> EJ
>
> recn.loc should be a matrix, not a data frame.
Hi
I've set recn.loc as a matrix and it worked but I'm still getting a error message from
predict.ssanova
> predict.ssanova(recs.splinex,recn.grid,se.fit=FALSE)
Error: subscript out of bounds
> colnames(recn.loc)
[1] "x" "y"
> colnames(recn.grid)
[1] "x" "y"
> is.matrix(recn.loc)
[1] TRUE
> is.matrix(recn.grid)
[1] TRUE
If I keep recn.grid has a data.frame I get
> predict.ssanova(recs.splinex,recn.grid,se.fit=FALSE)
Error in array(x, c(length(x), 1), if (!is.null(names(x))) list(names(x), :
attempt to set an attribute on NULL
Regards
EJ
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list