[R-sig-eco] GLS - Plotting Graphs with 95% conf interval

Chris Howden chris at trickysolutions.com.au
Tue Jul 12 02:34:13 CEST 2011


Hi sam,

I'm not familiar with the function with gls so can't help u with
that.. But if u get no joy on this list there is a mixed effects list
called r-sig-me.

Chris Howden
Founding Partner
Tricky Solutions
Tricky Solutions 4 Tricky Problems
Evidence Based Strategic Development, IP Commercialisation and
Innovation, Data Analysis, Modelling and Training

(mobile) 0410 689 945
(fax / office)
chris at trickysolutions.com.au

Disclaimer: The information in this email and any attachments to it are
confidential and may contain legally privileged information. If you are not
the named or intended recipient, please delete this communication and
contact us immediately. Please note you are not authorised to copy,
use or disclose this communication or any attachments without our
consent. Although this email has been checked by anti-virus software,
there is a risk that email messages may be corrupted or infected by
viruses or other
interferences. No responsibility is accepted for such interference. Unless
expressly stated, the views of the writer are not those of the
company. Tricky Solutions always does our best to provide accurate
forecasts and analyses based on the data supplied, however it is
possible that some important predictors were not included in the data
sent to us. Information provided by us should not be solely relied
upon when making decisions and clients should use their own judgement.

On 12/07/2011, at 2:02, "Cox, Samantha Lucy" <s.cox.10 at aberdeen.ac.uk> wrote:

> Hi, I am new to this group.  Firstly I am just wondering if there is a search option to look through back dated achrives (rather than having to mannually sift through all the threads by month)?
>
>
>
> Secondly (and the subject of this post) I am trying to plot the original data with the line of the model using the predict function.  I want to add SE to the graph, but not sure how to get them out as the predict function for gls (package nlme) does not appear to allow for SE=TRUE argument.
>
> Here is my code so far:
>
> f1<-formula(MaxNASC40_50~hu3+flcmax+TidalFlag)
>
> vf1Exp<-varExp(form=~hu3)
>
> B1D<-gls(f1,correlation=corGaus(form=Lat~Lon, nugget=TRUE),weights=vf1Exp , data=ocean)
>
> ochu3<-seq(from=2.9,to=4,length=120)
> ocflc<-seq(from=0,to=0.8,length=120)
> tidal1<-rep(c("1"),length=120)
>
> mydata1<-data.frame(TidalFlag=factor(tidal1),hu3=ochu3,flcmax=ocflc)
> lineNASC1<-predict(B1D,newdata=mydata1,type="response")
> lineNASC1<-as.data.frame(lineNASC1)
>
> plot(ocean$MaxNASC40_50[ocean$TidalFlag==1]~ocean$flcmax[ocean$TidalFlag==1)
> lines(lineNASC1$lineNASC1~mydata1$flcmax)
>
> Tidal Flag is a factor (so i assume i have to plot seperate graphs for each level).
>
> When I have tried to use the effects package I get the error:  Error in x$formula : object of type 'symbol' is not subsettable.
>
> Also (regarding plotting but a different modelling framework) when i have been trying to predict values from a zero inflated negative binomial (package pscl), I am getting the same line of fit regardless of what is on my X axis (depsite different variables have positive and negative relationships).
>
> any imput on any of these problems would be appreciated.
>
> Thanks
>
>   [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list