Displaying 13 results from an estimated 13 matches for "formula1".
Did you mean:
formula
2007 Aug 15
3
Formula in lm inside lapply
...roup)
df <- data.frame(y,x1,x2,group)
#write formula inside lm--works fine
res1 <- lapply(levels(df$group), function(x) lm(y~x1,df, subset = group
==x))
res1
res2 <- lapply(levels(df$group),function(x) lm(y~x1+x2,df, subset =
group ==x))
res2
#try to pass formula into lm()--does not work
formula1 <- as.formula(y~x1)
formula2 <- as.formula(y~x1+x2)
resf1 <- lapply(levels(df$group),function(x) lm(formula1,df, subset =
group ==x))
resf1
resf2 <- lapply(levels(df$group),function(x) lm(formula2,df, subset =
group ==x))
Resf2
The error message is
'Error in eval(expr, envir, encl...
2007 Feb 19
3
summary polr
Hi all,
I have a problem to estimate Std. Error and t-value by ?polr? in library Mass.
They result from the summary of a polr object.
I can obtain them working in the R environment with the following statements:
temp <- polr(formula = formula1, data = data1)
coeff <- summary(temp),
but when the above statements are enclosed in a function, summary reports the following error:
Error in eval(expr, envir, enclos) : object "dat" not found
Someone knows how I can solve the problem?
Thanks for any help.
Paolo
2024 May 15
2
Extracting values from Surv function in survival package
OS X
R 4.3.3
Colleagues
I have created objects using the Surv function in the survival package:
> FIT.1
Call: survfit(formula = FORMULA1)
n events median 0.95LCL 0.95UCL
SUBDATA$ARM=1, SUBDATA[, EXP.STRAT]=0 18 13 345 156 NA
SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=1 13 5 NA 186 NA
SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=2 5 5 168 81 NA
SUBDATA$ARM=2...
2024 May 16
1
Extracting values from Surv function in survival package
Hi Dennis,
look at the help page for summary.survfit, the Value n.event.
G?ran
On 2024-05-15 22:41, Dennis Fisher wrote:
> OS X
> R 4.3.3
>
> Colleagues
>
> I have created objects using the Surv function in the survival package:
>> FIT.1
> Call: survfit(formula = FORMULA1)
>
> n events median 0.95LCL 0.95UCL
> SUBDATA$ARM=1, SUBDATA[, EXP.STRAT]=0 18 13 345 156 NA
> SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=1 13 5 NA 186 NA
> SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=2 5 5 168...
2006 Nov 01
3
matrix manipulation with a for loop
...r each column (189) is pretty hard, so I want to write
a function in order to perform this automatically, such I have the
percent value corresponding to a specific column. I' tried these two
formulas but I can't get it. I think the problem is how to set the
initial values for the loop:
Formula1:
nnn<-function(x){for (i in F.zoo[,i]){
print(length(subset(F.zoo[,i],(F.zoo[,i]>=5) & (F.zoo[,i]<=
9)))/(length(F.zoo[,i])-length(subset(F.zoo[,i],is.na(F.zoo[,i]))))*100)
}
}
Formula 2:
H<-t(matrix(1,189))
nnn<-function(x){for (i in col(H){
print(length(subset(F.zo...
2007 Feb 20
0
R: Re: summary polr
...adia wrote:
>Hi all,
>
>I have a problem to estimate Std. Error and
>t-value by ???polr?? in library Mass.
>They result from the summary of a polr object.
>
>I can obtain them working in the R environment with the following statements:
>
> temp <- polr(formula = formula1, data = data1)
> coeff <- summary(temp),
>
>but when the above statements are enclosed in a
>function, summary reports the following error:
>
>Error in eval(expr, envir, enclos) : object "dat" not found
>
>Someone knows how I can solve the problem?
By gi...
2010 Dec 13
2
Does a formula object have a "left hand side"
Hello,
Does anyone know of a function that will determine whether
or not a formula object has a left hand side?
I.e., can differentiate between
y ~ x + z
and
~ x + z
Perhaps I'm overlooking the obvious...
Thanks!
2009 Feb 15
1
GLMM, ML, PQL, lmer
...ount random effects, there are more parameters than observations. When I
try to run the following code, I get an error saying: "Error in
mer_finalize(ans) : q = 295 > n = 236".
require (lme4)
require (glmmAK)
data(epilepticBC)
dat = epilepticBC
dat$rand=1:nrow(dat)
dat$V4=dat$visit==4
formula1 = Seizure ~ Base + Trt + I(Trt*Base) + Age + V4
fit=lmer (update (formula1, .~. + (1|id) + (1|rand)), family=poisson,
data=dat, nAGQ=1)
Is it true that there is no way to fit such a model in an ML analysis? In
other words, is there a way to approximate the likelihood of fixed effects
and variance...
2013 Jan 04
1
Predicting New Data -
I am having trouble predicting new data with a model created from package
mboost:
> mb1<-glmboost(as.formula(formula1),data=data_train,control=boost_control(mstop=400,nu=.1))
> f.predict<-predict(mb1,newdata=data_train)
Error in scale.default(X, center = cm, scale = FALSE) :
length of 'center' must equal the number of columns of 'x'
Ultimately I want to predict "data_test", bu...
2007 Oct 01
4
Disentagling formulas
I am writing a program in which I would like to take in a formula, change the response (Y) variable into something else, and then pass the formula, with the new Y variable to another function. That is, I am starting with
formula <- Y~X1+X2+X3
and I'd like to do something like
Y <- formula$Y
newY <- f(Y)
lm(newY~X1+X2+X3)
So far, it seems that my
2008 Apr 29
0
Prinde banii: 500 RON
...cei 500 RON pusi in concurs in fiecare saptamana.
Grabeste-te ai timp doar pana Marti.
***********************************************
Astazi Linkutil va recomanda:
http://cartelachip.paginirosii.ro o pagina despre: Cartela chip
http://campuscard.paginirosii.ro o pagina despre: Campuscard
http://formula1.paginirosii.ro o pagina despre: Formula 1
http://magaziededate.paginirosii.ro o pagina despre: Magazie de date
***********************************************
www.simb.eu
Acceseaza cel mai simplu motor de cautare www.simb.eu
Acum peste 2 milion de acesari zilnic, simplu pentru internet si mobil...
2010 Jun 13
1
ERROR need finite 'ylim' values
Hello:
I use R with MAC
I have a simple data table, numeric and text columns, named dt. The table is
imported through read.csv from a csv file. Row numbers are automatically
assigned, header is set to TRUE. there are 599 rows and several columns.
I am trying to plot using the stripchart command: one numeric variable (say
dt$fnatg) vs a text column (say dt$pat). dt$pat contains one of 3 values:
2003 Dec 01
0
No subject
...1.102]) by lists.samba.org
(Postfix) with ESMTP id F145E5121 for <samba@samba.org>; Wed, 16 May
2001 05:56:26 -0700 (PDT)
Received: by mono.org (8.11.0/8.11.0) id f4GCtAv21843; Wed, 16 May 2001
13:55:10 +0100 (BST)
Date: Wed, 16 May 2001 13:55:10 +0100 (BST)
From: David Brownlee <abs@formula1.com>
To: <samba@samba.org>
Cc: <tech-pkg@netbsd.org>
Subject: Serious problem in samba 2.2.0 under NetBSD 1.5
Message-ID: <Pine.NEB.4.33.0105161352210.354-100000@localhost>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: samba-admin@lists.samba.org
Errors-T...