Displaying 20 results from an estimated 3000 matches similar to: "formula and lm"
2004 Jul 15
5
formula
Hi, i 'dont understand how to take a general formula, view this:
x<-1:5
y<-c(0,1,1.7,2,2.1.4)
dummy<-data.frame(x=x,y=y)
formula<-"y~A*log(x)/log(2)"
formu<-as.formula(formula)
fm<-lm(formu,data=dummy)
Error in eval(expr, envir, enclos) : Object "A" not found
but A is the parameter of fitting, why is this?Thanks Ruben
2004 Jul 13
2
help with as.function
HI, sorry but i don't understand how to make a function with as.function()
formula<-"2+3*x"
formu<-as.symbol(formula)
> formu
2+3*x
formul<-as.function(alist(x=,formu))
curve(formul,1,5,col="blue")
Error in xy.coords(x, y, xlabel, ylabel, log) :
x and y lengths differ
> typeof(formul)
[1] "closure"
and not plot the curve function, Why?
2011 Jan 29
1
environment question: changing variables from a formula through model.frame?
Hello all,
I came across a behavior of R with environments that I'm not sure what is
causing it.
It involves changing variables that are found through using model.frame on a
formula inside a function.
I wonder if it's a "bug" or a "feature". And in either case, how it might
be managed.
Here is a simple example:
# let's say we have an x and y variables:
temp_x
2005 Jul 25
5
passing formula arguments cv.glm
I am trying to write a wrapper for the last example in help(cv.glm) that
deals with leave-one-out-cross-validation (LOOCV) for a logistic model.
This wrapper will be used as part of a bigger program.
Here is my wrapper funtion :
logistic.LOOCV.err <- function( formu=NULL, data=NULL ){
cost.fn <- function(cl, pred) mean( abs(cl-pred) > 0.5 )
glmfit <- glm(
2003 Nov 26
5
multiple peaks in data frame
Hello, it wanted to know how I can extract of a dates frame the values
peaks according to an interval that I
establish. For example if dates are:
1 23
2 4
3 56
4 7
5 99
6 33
extract the date i wanted to divide into intervals of 2 an
d to take alone the numbers 23, 56 and 99 of those 3 intervals. Thanks
Ruben
2017 Mar 10
2
named arguments in formula and terms
Hi, we came across the following unexpected (for us) behavior in
terms.formula: When determining whether a term is duplicated, only the
order of the arguments in function calls seems to be checked but not their
names. Thus the terms f(x, a = z) and f(x, b = z) are deemed to be
duplicated and one of the terms is thus dropped.
R> attr(terms(y ~ f(x, a = z) + f(x, b = z)),
2003 Oct 03
2
how to get condition number from lm output
Dear r-help,
I ran
output <- lm(formu, data=mydata)
I want to look at the condition number (to see if the matrix is near singular). How?
Also, I use the function stepAIC from MASS to select models, how can I see the condition numbers in each step?
While I am at it. I find a minor bug:
R 1.7.1 on window XP, when you copy and paste by click
one button, then the input stopped, until you
2004 Mar 29
2
how transform excell file to text file in R
Hello, it want to know if there is a library that transform a file in
excell (*. xls) to text file(*.txt, *,prn, *.csv). Thanks
2003 Sep 01
2
Axis color
Hello, my question is if I have two axes in a graphics as I can put him a
different color al axis and to the number of the scale. ? Thanks. Ruben
2011 Jan 26
1
boxplot - code for labeling outliers - any suggestions for improvements?
Hello all,
I wrote a small function to add labels for outliers in a boxplot.
This function will only work on a simple boxplot/formula command (e.g:
something like boxplot(y~x)).
Code + example follows in this e-mail.
I'd be happy for any suggestions on how to improve this code, for example:
- Handle boxplot.matrix (which shouldn't be too hard to do)
- Handle cases of complex
2024 Jul 14
2
xftrm is more than 100x slower for AsIs than for character vectors
? Fri, 12 Jul 2024 17:35:19 +0200
Hilmar Berger via R-devel <r-devel at r-project.org> ?????:
> This can be finally traced to base::rank() (called from
> xtfrm.default), where I found that
>
> "NB: rank is not itself generic but xtfrm is, and rank(xtfrm(x), ....)
> will have the desired result if there is a xtfrm method. Otherwise,
> rank will make use of ==, >,
2006 Nov 28
15
Determining ideal number of Mongrels for an app?
What''s a rule of thumb for guesstimating how many
Mongrels to use in a cluster for an app? I have an app
that gets about 5000 unique visitors per day. I
figured I''d give it plenty of Mongrels -- twenty to be
specific. After running out of memory and hitting the
swap periodically, I scaled it back to five and it
still seems to serve up visitors fine. So, is there
some super-secret
2024 Jul 12
1
xftrm is more than 100x slower for AsIs than for character vectors
Good evening,
I recently have observed slow merges when combining multiple data frames
derived from DataFrame and base::data.frame. I observed that the index
column of intermediate tables was of class <AsIs> (automatically
converted from character). The problem occurred mainly when using the
sorted = T option in base::merge.
This can be traced to xtfrm.AsIs being more than 100 times slower
2020 Oct 23
2
Change to I() in R 4.1
Hi there,
Is that change in R-devel intentional?
library(Matrix)
m <- as(matrix(c(0, 1)), "sparseMatrix")
isS4(m)
# [1] TRUE
x <- I(m)
# Warning message:
# In `class<-`(x, unique.default(c("AsIs", oldClass(x)))) :
# Setting class(x) to multiple strings ("AsIs", "dgCMatrix", ...);
result will no longer be an S4 object
2020 Oct 30
2
Change to I() in R 4.1
Hi Martin,
On 10/26/20 04:52, Martin Maechler wrote:
>>
>> Hi there,
>> Is that change in R-devel intentional?
>>
>> library(Matrix)
>> m <- as(matrix(c(0, 1)), "sparseMatrix")
>>
>> isS4(m)
>> # [1] TRUE
>>
>> x <- I(m)
>> # Warning message:
>> # In `class<-`(x,
2020 Oct 30
1
[External] Re: Change to I() in R 4.1
On Fri, 30 Oct 2020, Pages, Herve wrote:
>
> On 10/29/20 23:08, Pages, Herve wrote:
> ...
>>
>> I can think of 2 ways to move forward:
>>
>> 1. Keep I()'s current implementation but suppress the warning. We'll
>> make the necessary adjustments to DataFrame() to repair columns supplied
>> as I(<S4>) objects. Note that we would still be in
2012 Feb 17
1
como instalar plugin R en tiki
Estamos haciendo algunas pruebas pero no damos con la tecla, alguien tiene una idea de como instalarlo?
Muchas gracias!
Edwin Aguiar
Desarrollo y Bases de Datos
TICS EEA Corrientes
INTA
<v:f eqn="prod @7 21600 pixelHeig</v:formu
[[alternative HTML version deleted]]
2003 Sep 10
1
what is set.fit in function predict.lm
Hi, what es the parameter set.fit in function predict.lm, is set.fit True
then i need the standard error How i cant calculate it?. It is the different
what? i see the code of predict.lm How i cant see the matemathics formula
for the calculation of standard error.
2017 Oct 20
3
nls() and loop
Hello I?m need fitt growth curve with data length-age. I want to evaluate
which is the function that best predicts my data, to do so I compare the
Akaikes of different models. I'm now need to evaluate if changing the
initial values changes the parameters and which do not allow to estimate
the model.
To do this I use the function nls(); and I randomize the initial values
(real positive number).
2012 Feb 14
1
como pasar una variable como parametro en consulta query
Buenas tardes a todos. Tengo una duda sobre como programar en R el siguiente codigo:
#marcador 1 del mes 1
mes="abril"
P1 <- sqlQuery(ch, as.is=TRUE, paste("SELECT `value_DE` FROM `de` WHERE `month_DE`=''abril'' and `icg_DE`= 1"))
print(P1)
Mi problema es que debo crear una serie de querys que llamen a 13*60 datos, por lo cual la variable "mes" (en