Displaying 20 results from an estimated 100 matches similar to: "error in lm"
2003 Jun 25
2
probelem of function inside function
Hi,
I encountered a problem when I am trying to write my
own function which contains another function. To
simplify a problem, I tried the following simplified
function, hope someone can idenfity the problem for
me.
I have a simple data frame called "testdata" as
following:
>
2005 Aug 15
2
stepAIC invalid scope argument
I am trying to replicate the first example from stepAIC from the MASS
package with my own dataset but am running into error. If someone can
point where I have gone wrong, I would appreciate it very much. 
Here is an example :
 set.seed(1)
 df   <- data.frame( x1=rnorm(1000), x2=rnorm(1000), x3=rnorm(1000) )
 df$y <- 0.5*df$x1 + rnorm(1000, mean=8, sd=0.5)
 # pairs(df); head(df)
 lo  <-
2017 Jun 08
1
stepAIC() that can use new extractAIC() function implementing AICc
I would like test AICc as a criteria for model selection for a glm using 
stepAIC() from MASS package.
Based on various information available in WEB, stepAIC() use 
extractAIC() to get the criteria used for model selection.
I have created a new extractAIC() function (and extractAIC.glm() and 
extractAIC.lm() ones) that use a new parameter criteria that can be AIC, 
BIC or AICc.
It works as
2003 Apr 28
2
stepAIC/lme problem (1.7.0 only)
I can use stepAIC on an lme object in 1.6.2, but 
I get the following error if I try to do the same
in 1.7.0:
Error in lme(fixed = resp ~ cov1 + cov2, data = a, random = structure(list( : 
        unused argument(s) (formula ...)
Does anybody know why?
Here's an example:
library(nlme)
library(MASS)
a <- data.frame( resp=rnorm(250), cov1=rnorm(250),
                 cov2=rnorm(250),
2012 Jan 22
1
How to construct a formula
Hi,
I need to construct a formula programaticly, and pass it to a function 
such as the linear mixed model lme.  The help says it requires "a 
two-sided linear formula object describing the fixed-effects part of the 
model" but I do not know how to create this formula.  I have tried 
various things using formula(x, ...), as.formula(object, env = 
parent.frame()) and as.Formula(x, ...)
2002 Nov 05
1
add1 in glm
I'm having a bit of difficulty using the stepwise model-building tools 
in a glm context. Here, for example is one problem I have had using 
add1, where the abbreviation "." does not work as I expected it to do. I 
someone could point me towards some examples involving the interactive 
building of glm models I would be grateful.
The data set that I am using is the
2014 Aug 26
4
[Bug 10785] New: [PATCH] Add a flag to use numeric sort
https://bugzilla.samba.org/show_bug.cgi?id=10785
           Summary: [PATCH] Add a flag to use numeric sort
           Product: rsync
           Version: 3.1.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: core
        AssignedTo: wayned at samba.org
        ReportedBy: rom at rom1v.com
        
2013 Jun 25
1
F statistic in add1.lm vs add1.glm
Should the F statistic be the same when using add1() on models created by lm and glm(family=gaussian)?
They are in the single-degree-of-freedom case but not in the multiple-degree-of-freedom case.
MASS:addterm shows the same discrepancy.  It looks like the deviance (==residual sum of squares) gets
divided by the number of degrees of freedom for the term twice in add1.glm.  Using anova() on the
2008 Oct 11
1
step() and stepAIC()
The birth weight example from ?stepAIC in package MASS runs well as
indeed it should.
However when I change stepAIC() calls to step() calls I get warning
messages that I don't understand, although the output is similar.
Warning messages:
1: In model.response(m, "numeric") :
   using type="numeric" with a factor response will be ignored
(and three more the same.)
Checked
2009 Jan 23
2
R stepping through multiplie interactions
I have a lm in R in the form
model <- lm( Z ~ A*B*C*D,data=mydata)
I want to run the model and include all interactions expect the 4 way
(A:B:C:D) is there an easy way of doing this? I then want to step down the
model eliminating the non-significant terms I understand step() does this
but how would I do it by hand?
-- 
View this message in context:
2003 May 19
2
To update() or not to update()?
Hi,
Suppose I have:
  # Fit a base model
  d1.ph <- coxph(Surv(start, stop, event)~
               ejec + diavol + score + smoking +
               beta + surg.done,
               data = data.frame(foo))
  summary(update(d1.ph, . ~ . + td1))
  summary(update(d1.ph, . ~ . + td2)) 
As I have many columns in my data frame, foo, called td's.  e.g. td1, td2, 
td3, ....  And I'd like to
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
2017 Aug 23
0
MASS:::dropterm.glm() and MASS:::addterm.glm() should use ... for extractAIC()
Hi,
I have sent this message to this list the July, 7th. It was about a 
problem in MASS package.
Until now there is no change in the devel version.
As the problem occurs in a package and not in the R-core, I don't know 
if the message should have been sent here. Anyway, I have added a copy 
to Pr Ripley.
I hope it could have been fixed.
Sincerely
Marc
Le 09/07/2017 ? 16:05, Marc Girondot via
2005 Feb 25
0
Problem using stepAIC/addterm (MASS package)
Hello,
I'm currently dealing with a rather strange problem when using the
function "stepAIC" ("MASS" package).  The setting is the following: From
model learning data sets ("learndata"), I want to be able to build
prediction functions (in order to save them in a file for further use).
This is done by the function "pred.function" (see below). Therein,
2007 Jul 31
2
choosing between Poisson regression models: no interactions vs. interactions
R gurus,
I'm working on data analysis for a small project.  My response  
variable is total vines per tree (median = 0, mean = 1.65, min = 0,  
max = 24).  My predictors are two categorical variables (four sites  
and four species) and one continuous (tree diameter at breast height  
(DBH)).  The main question I'm attempting to answer is whether or not  
the species identity of a tree has
2007 Mar 13
3
inconsistent behaviour of add1 and drop1 with a weighted linear model
Dear R Help,
I have noticed some inconsistent behaviour of add1 and drop1 with a 
weighted linear model, which affects the interpretation of the results.
I have these data to fit with a linear model, I want to weight them by 
the relative size of the geographical areas they represent.
_________________________________________________________________________________________
 > example
          
2002 Apr 01
0
something confusing about stepAIC
Folks, I'm using stepAIC(MASS) to do some automated, exploratory, model
selection for binomial and Poisson glm models in R 1.3. Because I wanted to
experiment with the small-sample correction AICc, I dug around in the code
for the functions
	glm.fit
	stepAIC
	dropterm.glm
	addterm.glm
	extractAIC.glm
and came across something I just don't understand.
stepAIC() passes dropterm.glm() a
2017 Oct 27
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler,
I want to bring to your attention the following document: "What
happens if you omit the main effect in a regression model with an
interaction?" (https://stats.idre.ucla.edu/stata/faq/what-happens-if-you-omit-the-main-effect-in-a-regression-model-with-an-interaction).
This gives a useful review of the problem. Your example is Case 2: a
continuous and a categorical regressor.
2018 Dec 10
3
Solr
On 12/4/2018 10:40 AM, Joan Moreau via dovecot wrote:
>
> In the Wiki, ( https://wiki.dovecot.org/Plugins/FTS/Solr ), it would 
> nice to stipulate to the reader? to type the command :
>
> sudo -u solr /opt/solr/bin/solr create -c dovecot # to create the 
> dovecot instance
>
> before updating the schema.xml .
>
> Also,? schema.xml is in
2009 May 05
0
stepAICc function (based on MASS:::stepAIC.default)
Dear all,
I have tried to modify the code of MASS:::stepAIC.default(), dropterm() and addterm() to use AICc instead of AIC for model selection.
The code is appended below. Somehow the calculations are still not correct and I would be grateful if anyone could have a look at what might be wrong
with this code...
Here is a working example:
##
require(nlme)
model1=lme(distance ~ age + Sex, data =