Displaying 8 results from an estimated 8 matches for "fitmodel".
2002 May 17
0
options()$warn==2 and try()
...os solaris2.7
system sparc, solaris2.7
status
major 1
minor 5.0
year 2002
month 04
day 29
language R
I have a function called FitModels(), which simply takes in the
names of a data.frame and two variable names within that data.frame, and
fits and returns a list of objects from 2 coxph() fits, one main effects and
one interaction model. Sometimes the two variables are such that there is a
warning message: convergence has not been...
2010 Sep 19
2
working with eval and environments
I'm trying to get the following section of code to work, I think the problem
is being caused by the assignment of data to the lm function not evaluating
to "train" in the parent environment but I can't seem to figure out how to
do this.
fitmodel <- function(trial,data)
{
wrap.lm <- function(formula,data,...) { cat("in wrap lm",NROW(data),"\n");
lm(formula,data,...) }
wrap.step <- function(object,scope,...) { cat("in wrap
step",NROW(train),"\n"); step(object,scope,...) }
train <- dat...
2010 Oct 24
3
Long model formulae
What is a good way to enter a very long model formula. For example:
y ~ Input.2 + Input.3 + ... + Input.1000
(assuming the corresponding dataframe has many other columns).
Is there a way to convert a character string to a formula? Are there command line expansions in R besides the simple '.'?
Thanks.
[[alternative HTML version deleted]]
2012 Feb 01
1
Simulation confidence interval
The follwing is a code snippet from a power simulation
program that I'm using:
?
estbeta<-fixef(fitmodel)
?sdebeta<-sqrt(diag(vcov(fitmodel)))
? for(l in 1:betasize)
? {?
?? cibeta<-estbeta[l]-sgnbeta[l]*z1score*sdebeta[l]
??? if(beta[l]*cibeta>0)????????????? powaprox[[l]]<-powaprox[[l]]+1
????? sdepower[l,iter]<-as.numeric(sdebeta[l])
? }
?
Estbeta recovers the fixed effects from a...
2012 Jan 04
1
Is there a way to update a method on an existing Reference Class object?
...interactive
data analysis) is lost if everything have to be recalculated all the
time.
For example I would normally work something like this:
cl1 <- setRefClass("cl1",
? fields=list(x="data.frame"),
? methods=list(
? ? init=function(){"Read and process data"},
? ? fitModel=function(){"Fit different kind of models and keep the
results in x and other fields"},
? ? plotFit1=function(){"Plot the fit one way"},
? ? plotFit2=function(){"Plot the fit in another way way"})
)
I would then initialize it and run the functions on it:
cl1Object <...
2011 Dec 16
1
simulation
I'm using an R program (which I did not write) to simulate multilevel data
(subjects in locations) used in power calculations. It uses lmer to fit a
mixed logistic model to the simulated data based on inputs of means,
variances, slopes and proportions:
?
(fitmodel <- lmer(modelformula,data,family=binomial(link=logit),nAGQ=1))
where modelformula is set up in another part of the program.? Locations are
treated as random and the model is random intercept only.? The program is
set?to run 1000 simulations.
?
I have temperature, five levels of gestational age...
2011 Nov 15
1
package installtion
I'm getting the following error in a script: "Error: could not find function "lmer."??? I'm wondering of my lme4 package is installed incorrectly.? Can someone tell me the installation procedure?? I looked at the support docs but couldn't translate that into anything that would work.
2002 May 17
1
Re: [R] options()$warn==2 and try() (PR#1570)
>
> I have a function called FitModels(), which simply takes in the
> names of a data.frame and two variable names within that data.frame, and
> fits and returns a list of objects from 2 coxph() fits, one main effects and
> one interaction model. Sometimes the two variables are such that there is a
> warning message: conve...