search for: fmla

Displaying 20 results from an estimated 47 matches for "fmla".

Did you mean: fma
2005 Aug 16
4
as.character and a formula
Dear list, given this formula: > fmla <- formula(y1 ~ spp1 + spp2 + spp3 + spp5) > fmla[[3]] spp1 + spp2 + spp3 + spp5 is this the intended behaviour of as.character: > as.character(fmla[[3]]) [1] "+" "spp1 + spp2 + spp3" "spp5" ? Where does the extra "+" come from?...
2005 Jul 01
1
scope argument in step function
...data=ds3) Start: AIC= -32.66 Response ~ 1 Call: lm(formula = Response ~ 1, data = ds3) Coefficients: (Intercept) 1.301 is not working different from the following: > > cnames <- dimnames(ds3)[[2]] > cnames <- cnames[-444] # last col is Response > > fmla <- as.formula(paste(" ~ ",paste(cnames,collapse="+"))) > step(fit.0,scope=list(upper=fmla,lower=~1),data=ds3) Start: AIC= -32.66 Response ~ 1 > fmla <- as.formula(paste(" ~ ",paste(cnames,collapse="+"))) > fit.s <- step(fit.0,scope=list...
2012 Feb 28
2
update.formula has 512 char buffer?
...doing some preliminary fits of y ~ x1+ ...+xM, then want to add the conditional part of the equation using update(). Here's the test code: var1 <- 1:78 x1 <- paste("x", var1, sep="") f1 <- paste("f", var1[1:10], sep="") # use first 77 variables fmla <- as.formula( paste("y ~ ", paste(x1[1:77], collapse=" + ", sep=""), sep="")) fmla2 <- update(fmla, paste(". ~ . | ", paste(f1, collapse= " + "), sep="")) # CHANGE x to all 78 variables fmla <- as.formula( paste("...
2003 Oct 02
4
using a string as the formula in rlm
...uilt using various coulmns of the data frame. Thus a series of models would be m1 <- rlm(V1 ~ V2 + V3 + V4, data) m2 <- rlm(V1 ~ V2 + V5 + V7, data) m3 <- rlm(V1 ~ V2 + V8 + V9, data) I would like to automate this. Is it possible to use a string in place of the formula? I tried doing: fmla <- sprintf('V1 ~ V%g + V%g + V%g',2,3,4) m1 <-rlm(fmla,data) I get: Error in qr(x) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: NAs introduced by coercion I can understand why this method results in the error but is there any way to get around this?...
2003 Sep 25
1
data lost in cv.tree?
...<- 3 ny <- 4 y <- as.factor(c(1,0,1,1)) X <- data.frame(matrix(c(1:(nx*ny)), nrow = ny, ncol = nx, dimnames=list(c(),paste("x",1:nx,sep="")))) btr <- best.tree.lost(y~., X) print(summary(btr)) } best.tree.lost <- function (fmla, X) { tr <- tree(fmla, X) print(summary(tr)) cvtr <- cv.tree(tr, envir=parent.frame()) size <- cvtr$size[order(cvtr$dev)[1]] print(size) btr <- prune.tree(tr, best=size) btr } ################################################################## here.is.X <- function()...
2019 Sep 05
2
ARM vectorized fp16 support
Hi, I'm trying to compile half precision program for ARM, while it seems LLVM fails to automatically generate fused-multiply-add instructions for c += a * b. I'm wondering whether I did something wrong, if not, is it a missing feature that will be supported later? (I know there're fp16 FMLA intrinsics though) Test programs and outputs, $ clang -O3 -march=armv8.2-a+fp16fml -ffast-math -S -o- vfp32.c test_vfma_lane_f16: // @test_vfma_lane_f16 fmla v2.4s, v1.4s, v0.4s // fp32 is GOOD mov v0.16b, v2.16b re...
2012 Jan 25
4
formula error inside function
...Wb <- apply(Wb,1,sum) T <- -log(runif(n,0,1))*exp(-Z[,c('Z1','Z2')]%*%beta0-Wb) C <- runif(n,0,1) time <- ifelse(T<C,T,C) event <- ifelse(T<=C,1,0) mean(event) phmmd <- data.frame(Z) phmmd$cluster <- clusters phmmd$time <- time phmmd$event <- event fmla <- as.formula("Surv(time, event) ~ Z1 + Z2") BaseFun <- function(x){ start.coxph <- coxph(x, phmmd) print(start.coxph) betahat <- start.coxph$coefficient print(betahat) print(333) print(survfit(start.coxph))...
2011 Sep 19
1
Constrained regressions (suggestions welcome)
All, Could anyone recommend a package that allows the user to constrain the coefficients from a multiple regression equation? I tried using the gl1ce function in lasso2, but couldn't get it to work. I created a contrived example to illustrate my starting point. data(cars) fmla <- formula(dist ~ speed) gl1c.E <- gl1ce(fmla, data = cars) gl1c.E gl1c.E <- gl1ce(fmla, data = cars, link=identity()) gl1c.E I started with the example, but I think my data is more Gaussian than binomial. This returns the following errors. > data(cars) > fmla <-...
2004 Oct 11
0
scoping problem when calling step inside a function
...()) ## Forward stepwise regression - works fine set.seed(2863) x<-matrix(runif(1000),ncol=10) colnames(x)<-1:10 beta<-matrix(c(1,2,3,4,5,0,0,0,0,0),ncol=1) y<-drop(x %*% beta + rnorm(100)) lsdata<-data.frame(cbind(x=x,y=y)) xnam <- names(lsdata)[names(lsdata) != "y"] (fmla <- as.formula(paste("y ~ ", paste(xnam, collapse= "+")))) fit<-lm(y ~ 1,data=lsdata) step.fit<-step(fit,scope = fmla, direction="forward",data=lsdata) ## start from scratch rm(list=ls()) set.seed(2863) x<-matrix(runif(1000),ncol=10) colnames(x)<-1:10 be...
2011 Dec 19
1
pls help to print out first row of terms(model) output in example program
...onvenience function for multicollinearity diagnosis. I'd like to report to the user the formula that is used in a regression. I get output like this: > mcDiagnose(m1) [1] "The following auxiliary models are being estimated and returned in a list:" [1] "`x1` ~ ." formula(fmla)() [1] "`x2` ~ ." I'd like to fill in the period with the variable names that are in there. I know the information is in there, I just need to get it. The terms output for a fitted model has the output at the very top, in the first line, above the attributes. I just want to print...
2019 Sep 05
2
ARM vectorized fp16 support
...to compile half precision program for ARM, while it seems > LLVM fails to automatically generate fused-multiply-add instructions > for c += a * b. I'm wondering whether I did something wrong, if not, > is it a missing feature that will be supported later? (I know there're > fp16 FMLA intrinsics though) > > Test programs and outputs, > > $ clang -O3 -march=armv8.2-a+fp16fml -ffast-math -S -o- vfp32.c > test_vfma_lane_f16: // @test_vfma_lane_f16 > fmla v2.4s, v1.4s, v0.4s // fp32 is GOOD > mov...
2016 May 13
2
A question about AArch64 Cortex-A57 subtarget definition
...(S) - FP/ASIMD 0(F0) - FP/ASIMD 1(F1) So I think `A57UnitW` and `A57UnitX` should be the TableGen records defining pipeline F0 and F1, respectively. So `A57UnitW` and `A57UnitX` together compose a `ProcResGroup`, `A57UnitV`, which can execute a 128bit ASIMD floating point operation, such as FMLA(Q-form), in a single clock cycle. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ But in line 479-483 of `AArch64SchedA57.td`, as shown below ``` def A57WriteFPVMAD : SchedWriteRes<[A57UnitV]> { let Latency = 9; } def A57WriteFPVMAQ : SchedWriteRes<[...
2008 Aug 29
1
nls() fails on a simple exponential fit, when lm() gets it right?
...arithmicInit=function(mCall,LHS,data) { xy=sortedXyData(mCall[["x"]],LHS,data) aaa=0.01 #Just guess aaa=0.01 to start the fit bbb=min(xy$y) #Use the minimum y value as an initial guess for bbb value=c(aaa,bbb) names(value)=mCall[c("aaa","bbb")] return(value) } fmla=as.formula("~(aaa*log(x)+bbb)") SSlogarithmic=selfStart(fmla,initial=logarithmicInit,parameters=c("aaa","bbb")) exponenInit=function(mCall,LHS,data) { xy=sortedXyData(mCall[["x"]],LHS,data) r=0.01 #Just guess r=0.01 to start the fit A=min(xy$y) #Use t...
2003 Mar 02
1
model.frame.default problem in function definition
Could someone point me in the right direction for the following issue: A function is defined as follows: tfun <- function(dat) { fmla <- as.formula("y~x+z") dat2 <- dat mdl <- lm(fmla,dat2) mdl <- step(mdl) } Then the following code dat <- data.frame(x=1:10,z=1:10,y=(1:10)^2+10*(1:10)) tfun(dat) generates the output Start: AIC= 43.67 y ~ x + z Error in model.frame.default(for...
2005 Jul 20
1
aregImpute in Hmisc
Hi, I have a dataframe ds1.2 - 503 categorial variables and 1 continuous response variables. I ran aregImpute to deal with NA's and got the followig error: > fmla = terms( Response ~ . ,data=ds1.2) > ds.i = aregImpute(fmla,data=ds1.2) Error in matrix(as.double(1), nrow = n, ncol = p, dimnames = list(rnam, : length of dimnames [2] not equal to array extent Could you explain what I should do? Thanks a lot. Young.
2005 Jun 24
1
"Error in contrasts" in step wise regression
Hi, I have a problem in getting step function work. I am getting the following error: > fit1 <- lm(Response~1) > fmla <- as.formula(paste(" ~ ",paste(colnames,collapse="+"))) > sfit <- step(fit1,scope=list(upper= fmla,lower= ~1),k=log(nrow(dat))) Start: AIC= -1646.66 Response ~ 1 Error in "contrasts<-"(`*tmp*`, value = "contr.treatment") : contrasts...
2006 May 24
1
Problem with pasteing formulas (PR#8897)
Hi, If I create a formula with say 100 terms and then paste it: xnam <- paste("x", 1:100, sep="") fmla <- as.formula(paste("y ~ ", paste(xnam, collapse= "+"))) paste(fmla) The result seems to cut off everything after the first 500 characters and gives no warning message. I have the most recent version of R from the R website and the problem occurs on both Unix and Windows...
2012 May 29
3
trouble automating formula edits when log or * are present; update trouble
...g doesn't get right. Here's the test code: ##PJ ## 2012-05-29 dat <- data.frame(x1=rnorm(100,m=50), x2=rnorm(100,m=50), x3=rnorm(100,m=50), y=rnorm(100)) m1 <- lm(y ~ log(x1) + x1 + sin(x2) + x2 + exp(x3), data=dat) m2 <- lm(y ~ log(x1) + x2*x3, data=dat) suffixX <- function(fmla, x, s){ upform <- as.formula(paste0(". ~ .", "-", x, "+", paste0(x, s))) update.formula(fmla, upform) } newFmla <- formula(m2) newFmla suffixX(newFmla, "x2", "c") suffixX(newFmla, "x1", "c") The last few lines of...
2010 Dec 26
1
Calculation of BIC done by leaps-package
...e by extractAIC but it doesn't! Maybe anyone can tell me about the reason of the variation of the BIC-values? Best regards, Jan Henckens ### Minimal Example: require(leaps) bridge <- read.table("http://www.stat.tamu.edu/~sheather/book/docs/datasets/bridge.txt", header=TRUE) fmla.full <- formula(Time ~ .) (lm.model <- summary(regsubsets(fmla.full,data=bridge,weights=NULL, intercept=TRUE, method="forward"))) lm.model$bic ### The first two models constructed via lm(): extractAIC(lm(Time~Dwgs,data=bridge),k=log(nrow(bridge))) extractAIC(lm(Time~Dwgs+Case,data=...
2007 Nov 26
1
mvr error in PLS package
All, I have been using a data set to build pls models for three different soil properties. Two of the three models run fine; however I receive the following error for the final model. > libs.IC.cal <- mvr(libs.IC.fmla, data = libsdata.cond.cal, ncomp=20,validation = "LOO", method = "oscorespls") Error in colMeans(x, n, prod(dn), na.rm) : 'x' must be numeric There are many "0" for this soil property. Could this cause the error? Best, Ross **********************...