similar to: How to bind models into a list of models?

Displaying 20 results from an estimated 20000 matches similar to: "How to bind models into a list of models?"

2012 Feb 13
2
R's AIC values differ from published values
Using the Cement hardening data in Anderson (2008) Model Based Inference in the Life Sciences. A Primer on Evidence, and working with the best model which is lm ( y ~ x1 + x2, data = cement ) the AIC value from R is model <- lm ( formula = y ~ x1 + x2 , data = cement ) AIC ( model ) 64.312 which can be converted to AICc by adding the bias
2012 Jan 17
1
MuMIn package, problem using model selection table from manually created list of models
The subject says it all really. Question 1. Here is some code created to illustrate my problem, can anyone spot where I'm going wrong? Question 2. The reason I'm following a manual specification of models relates to the fact that in reality I am using mgcv::gam, and I'm not aware that dredge is able to separate individual smooth terms out of say s(a,b). Hence an additional request,
2010 Oct 12
1
delta AIC for models with 2 variables using MuMIn
Dear List, I want to ask a AIC question based on package library(MuMIn) The relative importance of 16 explanatory variables are assessed using delta AIC in a generalized linear model. Please kindly advise if it is possible to show models with any two only certain variables. Thank you. Elaine I asked a similar question and got a great help for models with only one variable as below.
2008 Mar 29
1
Tabulating Sparse Contingency Table
I have a sparse contingency table (most cells are 0): > xtabs(~.,data[,idx:(idx+4)]) , , x3 = 1, x4 = 1, x5 = 1 x2 x1 1 2 3 1 0 0 31 2 0 0 112 3 0 0 94 , , x3 = 2, x4 = 1, x5 = 1 x2 x1 1 2 3 1 0 0 0 2 0 0 0 3 0 0 0 , , x3 = 3, x4 = 1, x5 = 1 x2 x1 1 2 3 1 0 0 0 2 0 0 0 3 0 0 0 , , x3 = 1, x4
2012 Jan 05
1
delete.response leaves response in attribute dataClasses
I posted this one as an R bug (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14767), but Prof. Ripley says I'm premature, and I should raise the question here. Here's the behavior I assert is a bug: The output from delete.response on a terms object alters the formula by removing the dependent variable. It removes the response from the "variables" attribute and it changes
2013 Apr 13
1
how to add a row vector in a dataframe
Hi, Using S=1000 and simdata <- replicate(S, generate(3000)) #If you want both "m1" and "m0" #here the missing values are 0 res1<-sapply(seq_len(ncol(simdata.psm1)),function(i) {x1<-merge(simdata.psm0[,i],simdata.psm1[,i],all=TRUE); x1[is.na(x1)]<-0; x1}) res1[,997:1000] #????? [,1]???????? [,2]???????? [,3]???????? [,4]??????? #x1??? Numeric,3000 Numeric,3000
2003 Oct 05
3
stepAIC problem
Dear R-users I have a probelm running stepAIC in R1.7.1 I wrote a program which used stepAIC as a part of it, and it worked fine while I was using the previous version of R1.7.0. However, I found the program did not work any more. Now, R produces a message which tells "Error in as.data.frame.default(data) : can't coerce function into a data.frame" every time I run the part of
2012 Sep 12
3
how to create a substraction matrix (subtract a row of every column from the same row in other columns)
Hello I have data like this x1 x2 x3 x4 x5 I want to create a matrix similar to a correlation matrix, but with the difference between the two values, like this x1 x2 x3 x4 x5 x1 x2-x1 x3-x1 x4-x1 x5-x1 x2 x3-x2 x4-x2 x5-x2 x3 x4-x3 x5-x3 x4 x5-x4 x5 Then I
2005 Oct 05
1
Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format. --=_alternative 004613C000257091_= Content-Type: text/plain; charset="US-ASCII" And some more informastion I forgot. R does not crash if I write out the formula: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <-
2006 Aug 16
1
Specifying Path Model in SEM for CFA
I'm using specify.model for the sem package. I can't figure out how to represent the residual errors for the observed variables for a CFA model. (Once I get this working I need to add some further constraints.) Here is what I've tried: model.sa <- specify.model() F1 -> X1,l11, NA F1 -> X2,l21, NA F1 -> X3,l31, NA F1 -> X4,l41, NA F1 -> X5, NA, 0.20
2004 Sep 27
1
random discrete from the first tuple
Dear UseR I have a dataset, for instance x1(A, B, C), x2(M,F), x3(X1,X2,X3,X4) and x4(W,F,P). I want to make a small dataset with the random tuple. I know package e1071 can handle a random discrete, > library(e1071) > x1 <- rdiscrete(6, c(2,2,2), c("A","B","C")) > x2 <- rdiscrete(6, c(3,3), c("M","F")) > x3 <-
2005 Apr 22
3
as.data.frame: Error in "names<-.default" (PR#7808)
Hello, I found a potential problem in R 2.1.0 (and R 2.0.1) I expect that > tmp <- FUN(x1, x2, x3, x4) > as.data.frame(tmp) is the same as > as.data.frame(FUN(x1, x2, x3, x4)) since the tmp variable in this case is unnecessary. However, below I will demonstrate that under an odd set of conditions, I can correctly perform as.data.frame(tmp), but not as.data.frame(FUN(x1, x2, x3,
2008 Aug 01
5
drop1() seems to give unexpected results compare to anova()
Dear all, I have been trying to investigate the behaviour of different weights in weighted regression for a dataset with lots of missing data. As a start I simulated some data using the following: library(MASS) N <- 200 sigma <- matrix(c(1, .5, .5, 1), nrow = 2) sim.set <- as.data.frame(mvrnorm(N, c(0, 0), sigma)) colnames(sim.set) <- c('x1', 'x2') # x1 & x2 are
2005 Jun 07
1
Help with possible bug (assigning NA value to data.frame) ?
There's something peculiar that I do not understand here. However, did you realize that the thing you are assigning into parts of `a' is NULL? Check you're my.test.boot.ci.1: It's NULL. Be that as it may, I get: > a <- data.frame(matrix(1:4, nrow=2), X3=NA, X4=NA) > a X1 X2 X3 X4 1 1 3 NA NA 2 2 4 NA NA > a[a$X1 == 1,]$X3 <- NULL > a X1 X2 X3 X4 1 1
2007 Sep 01
2
Comparing "transform" to "with"
Hi All, I've been successfully using the with function for analyses and the transform function for multiple transformations. Then I thought, why not use "with" for both? I ran into problems & couldn't figure them out from help files or books. So I created a simplified version of what I'm doing: rm( list=ls() ) x1<-c(1,3,3) x2<-c(3,2,1) x3<-c(2,5,2)
2012 Apr 20
1
predictOMatic for regression. Please try and advise me
I'm pasting below a working R file featuring a function I'd like to polish up. I'm teaching regression this semester and every time I come to something that is very difficult to explain in class, I try to simplify it by writing an R function (eventually into my package "rockchalk"). Students have a difficult time with predict and newdata objects, so right now I'm
2013 May 29
3
bootstrap
Hi, You might need to check library(boot).? I have never used that before.? So, I can't comment much.? It is better to post on R-help list.? I had seen your postings on Nabble in the past.? Unfortunately those postings were not accepted in R-help.? You have to directly post at ? r-help at r-project.org after registering at: https://stat.ethz.ch/mailman/listinfo/r-help ?
2005 Jul 23
2
cor(X) with P-Value
Friends I am new to R (and statistics) so am struggling a bit. Briefly... I am interested in getting the P-Value from cor(X) where X is a matrix. I have found cor.test. Verbosely... I have 4 vectors and can generate the corellation matrix... > cor(cbind(X1, X2, X3, X4)) X1 X2 X3 X4 X1 1.00000000 -0.06190365 -0.156972795 0.182547517 X2
2010 Aug 17
2
AIC in MuMIn
Hello, I am using package MuMIn to calculate AIC for a full model with 10 explanatory variables. Thanks in advance in sharing your experience. Q1 In the AIC list of all models, each model is differentiated by model number. Please kindly advise if it is possible to find the corresponding explanatory variable(s) for the model number. Q2 error message I tried to display sub-model with only
2008 Dec 22
1
sem package fails when no of factors increase from 3 to 4
#### I checked through every 3 factor * 3 loading case. #### While, 4 factor * 3 loading failed. #### the data is 6 factor * 3 loading require(sem); cor18<-read.moments(); 1 .68 1 .60 .58 1 .01 .10 .07 1 .12 .04 .06 .29 1 .06 .06 .01 .35 .24 1 .09 .13 .10 .05 .03 .07 1 .04 .08 .16 .10 .12 .06 .25 1 .06 .09 .02 .02 .09 .16 .29 .36 1 .23 .26 .19 .05 .04 .04 .08 .09 .09 1 .11 .13 .12 .03 .05 .03