Displaying 20 results from an estimated 2000 matches similar to: "lm() question"
2008 Jun 13
2
Quartile regression question
I have data that looks like
lake,loglength,logweight
1,2.369215857,1.929418926
1,2.426511261,2.230448921
1,2.434568904,2.298853076
1,2.437750563,2.298853076
1,2.442479769,2.230448921
1,2.445604203,2.356025857
...
102,2.722633923,3.310268367
102,2.781755375,3.502153893
102,2.836324116,3.683407299
102,2.802773725,3.583312152
102,2.790285164,3.546419267
102,2.806179974,3.599118565
2010 Aug 23
2
Quantile Regression and Goodness of Fit
All -
Does anyone know if there is a method to calculate a goodness-of-fit
statistic for quantile regressions with package quantreg?
Specifically, I'm wondering if anyone has implemented the
goodness-of-fit process developed by Koenker and Machado (1999) for R?
Though I have used package quantreg in the past, I may have overlooked
this function, if it is included.
Citation:
Koenker, R. and
2008 Jun 10
3
newbie nls question
I'm tyring to fit a relatively simple nls model to some data, but keep coming up against the same error (code follows):
Oto=nls(Otolith ~ Linf*(1-exp(-k(AGE-to))),
data = ages,
start = list(Linf=1000, k=0.1, to=0.1),
trace = TRUE)
The error message I keep getting is "Error in eval(expr, envir, enclos) : could not find function "k"". I've used this
2008 Aug 22
2
Newbie programming help
All -
Not sure if this is a real programming question, but here goes:
I have data that looks like
Lake Length Weight
1 158 45
1 179 70
1 200 125
1 202 150
1 206 145
1 209 165
1 210 140
1 215 175
1 216 152
1 220 150
1 221 165
...
where lake goes from 1 - 84 and the number of rows for each lake is variable (but > ~20).
I'm trying to do two things: 1) build a simple linear model of the
2008 Dec 18
2
Contextstack overlow
All -
I have a number of rows that I am assigning length classes to via
l.class<-with(wae,
ifelse((Length>=120)&(Length<130),"125",
ifelse((Length>=130)&(Length<140),"135",
ifelse((Length>=140)&(Length<150),"145",
ifelse((Length>=150)&(Length<160),"155",
2008 Jun 12
2
Predicting from an nls model
I keep running up against the same error when I try to plot a line from a nls model. The data is fisheries length/weight data. Code follows:
require(graphics)
pow = nls(Weight~alpha*Length^beta, data=wae,
start=list(alpha=0.0000001, beta=3.0), trace=TRUE)
predict(pow)
plot(Weight~Length,
2008 Sep 02
2
nls.control()
All -
I have data:
TL age
388 4
418 4
438 4
428 5
539 10
432 4
444 7
421 4
438 4
419 4
463 6
423 4
...
[truncated]
and I'm trying to fit a simple Von Bertalanffy growth curve with program:
#Creates a Von Bertalanffy growth model
VonB=nls(TL~Linf*(1-exp(-k*(age-t0))), data=box5.4,
start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE)
#Scatterplot of the data
plot(TL~age, data=box5.4,
2008 Aug 29
1
lm() and dffits
All -
My question is a bit involved, so bear with me.
I have some data that looks like:
Lake LL LW
81 2.176091259 1.342422681
81 2.176091259 1.414973348
81 2.176091259 1.447158031
81 2.181843588 1.414973348
81 2.181843588 1.447158031
81 2.184691431 1.462397998
81 2.187520721 1.447158031
81 2.187520721 1.477121255
81 2.187520721 1.505149978
...
[truncated]
I'm trying to:
1) fit a simple
2008 Jul 03
1
lines() warning message
I have data that looks like
Year,Recruit,Spawner,Mtempcv
1958,4532,775,0.24125
1959,22996,2310,0.16319
1960,628,2990,0.46056
1961,879,1400,0.33028
1962,14747,1130,0.22618
1963,13205,790,0.20596
1964,31793,1195,0.19229
1965,10621,981,0.20363
1966,22271,870,0.3452
1967,8736,1104,0.27511
1968,8761,883,0.10884
1969,18885,1421,0.17799
1970,10098,1198,0.2106
1971,3394,760,0.22098
1972,1697,1354,0.39461
2008 Aug 01
1
Confidence intervals with nls()
I have data that looks like
O.lengthO.age
176 1
179 1
182 1
...
493 5
494 5
514 5
606 5
462 6
491 6
537 6
553 6
432 7
522 7
625 8
661 8
687 10
704 10
615 12
(truncated)
with a simple VonB growth model from within nls():
plot(O.length~O.age, data=OS)
Oto = nls(O.length~Linf*(1-exp(-k*(O.age-t0))), data=OS,
start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE)
mod <- seq(0, 12)
2012 Apr 16
2
Problems with subset, droplevels and lm: variable lengths differ
[Env: R 2.14.2 / Win Xp]
In the script below, I want to select some variables from
rrcov::OsloTransect, delete cases with
any missing data, and subset the data frame Oslo to remove cases for two
levels of the
factor litho that occur with low frequency.
The checks I run on my new data frame Oslo look OK, but I when I try to
fit a multivariate
linear model with lm(), I am getting an error:
2008 Aug 19
1
Histogram binning
I am trying to produce frequencies in defined intervals however I can't seem
to figure out how to get R to bin my data the way I want it to.
I have several thousand lengths of fish that I want to be binned as follows:
Ex.
Length Bin
209 200
219 210
431 430
727 720
That is, bins with any length equal to or greater than the lower
2002 Oct 29
1
samba compiling error
Hello,
I have error on compiling time
I tried on HP-UX 11.00 system with gcc version 3.1 to compile samba source
Samba latest version source was dowloaded from www.us1.samba.org/samba/ftp
I attached log file with this error
thank you.
begin 600 samba_make.log.doc
M(R!M86ME#0HO=7-R+VQO8V%L+W-A;6)A+V)I;B(@+410241$25(](B]U<W(O
M;&]C86PO<V%M8F$O=F%R+VQO8VMS(B
2006 Aug 04
1
Integration and Loop in R
Dear All,
I have seldom needed to use loops in R, but now I need to code a loop
with a stride different from one.
In the R manual I downloaded I have the example:
> xc <- split(x, ind)
> yc <- split(y, ind)
> for (i in 1:length(yc)) {
plot(xc[[i]], yc[[i]]);
abline(lsfit(xc[[i]], yc[[i]]))
}
but in my case I'd like to add a condition so that i varies by 4 from
one go
2009 Mar 12
8
help with loop
Dear useRs,
I'm trying to write a loop to sum my data in the following way:
(the second - the first) + (the third - the second) + (the fourth - the third) + ...
for each column.
So, I wrote something like this:
c <- list()
for(i in 1:ncol(mydata)) {
for(j in 2:nrow(mydata)) {
c[[i]] <- sum(yc[j,i] - yc[(j-1),i])
}}}
As for the columns it works pretty fine, but it only
2011 Jan 17
1
isoreg memory leak?
I believe there is a memory leak in isoreg in the current version of R,
as I believe the following shows
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 120405 3.3 350000 9.4 350000 9.4
Vcells 78639 0.6 786432 6.0 392463 3.0
> for(k in 1:100) {
+
+ y <- runif(10000)
+ isoreg(x,y)
+ }
> rm(x)
> rm(y)
> gc()
used (Mb) gc
2010 Nov 19
1
TukeyHSD error
All -
I think I'm being dense, but for the life of me, I can't figure out
why I get error message with the code below.
I have data that looks like
param level perc.surv asin.tran
DO 3 0.6864407 0.9764544
DO 3 0.1250000 0.3613671
DO 3 0.8738739 1.2077299
DO 4 0.4615385 0.7468986
DO 4 0.5691057 0.8547258
DO 4 0.8504673 1.1737517
DO 6 0.5494505 0.8349297
DO
2011 Jan 26
1
aggregate(as.formula("some formula"), data, function) error when called from in a function
I'm having a problem with aggregate.formula when I call it in a function and the function is converted from a string in the funtion
I think my problem may also only occur when the left hand side of the formula is cbind(...)
Here is example code that generates a dataset and then the error.
The first function "agg2" fails
> agg2(FALSE)
do agg 2
Error in m[[2L]][[2L]] : object
2008 Dec 22
3
Summary information by groups programming assitance
All -
I have data that looks like
psd Species Lake Length Weight St.weight Wr
Wr.1 vol
432 substock SMB Clear 150 41.00 0.01 95.12438
95.10118 0.0105
433 substock SMB Clear 152 39.00 0.01 86.72916
86.70692 0.0105
434 substock SMB Clear 152 40.00 3.11 88.95298
82.03689 3.2655
435 substock SMB Clear
2003 Nov 05
3
using LSODA in R
R help list subscribers,
I am a new user of R. I am attempting to use R to explore a set of
equations specifying the dynamics of a three trophic level food chain. I
have put together this code for the function that is to be evaluted by
LSODA. My equations Rprime, Cprime, and Pprime are meant to describe the
actual equation of the derivative. When I run LSODA, I do not get the
output that