search for: formu

Displaying 11 results from an estimated 11 matches for "formu".

Did you mean: form
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 <- rep(1,5) temp_y <- c(1:5) # we now create a function that will take a formul...
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( formula=formu, data=data, family="binomial" ) print("glmfit is OK") err <- cv.glm( data=data, glmfit=glmfit, cost=cost.fn, K...
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 f...
2004 Jul 15
2
formula and lm
Hi, don' t understand why the function fomula have this error, i enclose the parameter "a" with the function I() Thank Ruben x<-1:5 y<-c( 2 ,4 , 6 , 8 ,11) formu<-y~I(a*x) form<-formula(formu) dummy<-data.frame(x=x,y=y) fm<-lm(form,data=dummy) Error in unique(c("AsIs", oldClass(x))) : Object "a" not found
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?Th...
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 functions (e.g: boxplot(y~a*b)) -...
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 b...
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]]
2017 Oct 20
3
nls() and loop
...ce=FALSE) + caimansum<-summary(caiman)#ME DA LOS PARAMETROS ESTIMADO, EL NUM DE ITERACIONES + ## analizamos akaike + akaike<-AIC(caiman) + Bayesiano<-BIC(caiman) + alfa<-coef(caiman)[1] + beta<-coef(caiman)[2] + gamma<- coef(caiman)[3] + DE<- coef(caiman)[4] + formu<-formula(caiman) + + ValoresIniciales<-c(a, g, d) + resultados<-list(formu, caimansum, ValoresIniciales, akaike, Bayesiano) + return(resultados) + } > Logiscorri() [[1]] SVL ~ DE + (alfa/(1 + exp(-gamma * ANO))) <environment: 0x16a6b89c> [[2]] Formula: SVL ~ DE + (alfa/(1...
2012 Feb 14
1
como pasar una variable como parametro en consulta query
...permitiera automatizar la consulta. Ruego disculpen si la pregunta es muy elemental, son mis primeras armas en este lenguaje, y agradezco vtra ayuda. Edwin Aguiar Desarrollo y Bases de Datos TICS EEA Corrientes INTA <v:f eqn="prod @7 21600 pixelHeig</v:formu [[alternative HTML version deleted]]
2017 Oct 20
0
nls() and loop
...caiman)#ME DA LOS PARAMETROS ESTIMADO, EL NUM DE >ITERACIONES >+ ## analizamos akaike >+ akaike<-AIC(caiman) >+ Bayesiano<-BIC(caiman) >+ alfa<-coef(caiman)[1] >+ beta<-coef(caiman)[2] >+ gamma<- coef(caiman)[3] >+ DE<- coef(caiman)[4] >+ formu<-formula(caiman) >+ >+ ValoresIniciales<-c(a, g, d) >+ resultados<-list(formu, caimansum, ValoresIniciales, akaike, >Bayesiano) >+ return(resultados) >+ } >> Logiscorri() >[[1]] >SVL ~ DE + (alfa/(1 + exp(-gamma * ANO))) ><environment: 0x16a6b89c&g...