[R] vglm

Gavin Simpson gavin.simpson at ucl.ac.uk
Wed Sep 1 10:23:45 CEST 2010


On Wed, 2010-09-01 at 11:05 +0800, Dejian Zhao wrote:
> try
> fit=vglm(mydata[,"Loss"]~1,pareto1(location=alpha),trace=TRUE,crit="c")

No, please don't. That is not a good example of formula use in R.
Several responders have already pointed out that the 'R' way of doing
this would be to use a data argument to tell vglm where to find the
variables mentioned in the formula. So your example would become:

fit <- vglm(Loss ~ 1, data = mydata, family = pareto1(location = alpha),
            trace = TRUE, crit = "coef")

HTH

G

> 
> On 2010-9-1 3:20, choonhong ang wrote:
> > Hi All,
> >
> > could anybody help me to understand what is this error means ?
> >
> >
> > mydata=read.table("C:/Documents and
> > Settings/angieb/Desktop/CommercialGL/cl_ilf_claimdata.csv",header=TRUE,sep=",")
> >    
> >> names(mydata)
> >>      
> > [1] "ILFTable"    "liabLimit"   "AnnAggLimit" "DedAmt"      "Loss"
> > "TIL"
> >    
> >> fit=vglm(Loss~1,pareto1(location=alpha),trace=TRUE,crit="c")
> >>      
> > Error in eval(expr, envir, enclos) : object "Loss" not found
> >
> > 	[[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at 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.
> >
> >
> >
> >
> 
> ______________________________________________
> R-help at 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.

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list