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]]
On Aug 31, 2010, at 3:20 PM, 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 foundWithout looking at the vglm documentation, my first guess is that this might have succeeded had you included a, data=mydata, argument. That is pretty much standard practice in R regression functions. "Loss" is not an R object but rather a column name inside mydata. -- David Winsemius, MD West Hartford, CT
Hi, My guess is that vglm() cannot find "Loss" because you have not set the data argument. Something like: fit = vglm(Loss ~ 1, pareto1(location = alpha), trace = TRUE, crit "c", data = mydata) out to work if "Loss" is a variable in the object "mydata" HTH, Josh On Tue, Aug 31, 2010 at 12:20 PM, choonhong ang <angie.bearman at gmail.com> 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. >-- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/
try fit=vglm(mydata[,"Loss"]~1,pareto1(location=alpha),trace=TRUE,crit="c") 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. > > > >
I am glad it works. But you should reply to the list, thus more people can trace the process of the question. As to your second question, I have no idea how to solve it. I suggest you start another thread. There will be someone able to answer you in the R mailing list. Remember to reply to the list, thus you can get more answers from the list. On 2010-9-2 4:44, choonhong ang wrote:> Hi, > thank you & it is working now. > i have another question that from the R documentation, for pareto1if > the estimate of k is less or equal to unity then the fitted values > will be NA. I have the same problem that my fitted values is NA. > from the R document (fit@extra <mailto:fit@extra> is to get the > estimate of alpha, how about to get the estimate of k ?) > any idea how to solve the NA problem ? > thanks again > > On Tue, Aug 31, 2010 at 10:05 PM, Dejian Zhao <zhaodj@ioz.ac.cn > <mailto:zhaodj@ioz.ac.cn>> wrote: > > try > fit=vglm(mydata[,"Loss"]~1,pareto1(location=alpha),trace=TRUE,crit="c") > > > > 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@r-project.org <mailto:R-help@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 > <http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > > > ______________________________________________ > R-help@r-project.org <mailto:R-help@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 > <http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > >[[alternative HTML version deleted]]