Displaying 20 results from an estimated 7000 matches similar to: "a question on statistics (rather than R-specific)"
2002 Jun 04
2
machine dependency [polr()/optim()]
Dear R experts:
I am running some calculations using polr() in MASS library, and found some
differences in results obtained on two different machines (IRIX 6.5, and
Linux RH 7.1). It is not clear to me whether this is due to some error in
my programming the calculation and how to resolve the differences, if
possible.
The polr() call is the following:
2011 Apr 15
3
GLM output for deviance and loglikelihood
It has always been my understanding that deviance for GLMs is defined
by;
D = -2(loglikelihood(model) - loglikelihood(saturated model))
and this can be calculated by (or at least usually is);
D = -2(loglikelihood(model))
As is done so in the code for 'polr' by Brian Ripley (in the package
'MASS') where the -loglikehood is minimised using optim;
res <-
2002 May 02
1
how to trap any warnings from an R function -- again :(
With the incorporation of the useful hints, my user function now looks like
this:
userfn <- function() {
...
ow <- options("warn")
options(warn = 2);
...
reg<-try(polr(act~.,data=mm,Hess=TRUE))
...
sumreg<-try(summary(reg))
print(length(sumreg))
print(sumreg)
...
options(ow) # reset
}
The routine userfn() is called multiple times, two of which I happen to know
to
2002 Apr 29
3
how to trap any warnings from an R function
Within an user function, how are the warnings from an R function be trapped
(such that some proper actions can be taken)? 'last.warning' is returned
only at the top level. Pointers are appreciated.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2002 Feb 07
1
newbie question: polr and glm.control
I'm running polr() and getting warning messages from glm.fit(). It seems
reasonable to use glm.control() to turn on the trace and follow what
glm.fit() does when called by polr(); or is it?
glm.control(maxit=10, trace=TRUE)
polr(act~., data=mm)
The glm.control() sets the trace TRUE, but there's no change in the output
from polr().
Many thanks in advance for any help/pointers.
2006 Aug 15
1
coefficients' order in polr()?
Hi all,
I am using polr(). The resulting coefficients of first levels are always 0.
What to do if I wnat to get the coefficients of the last level 0.
For example, suppose x has 3 levels, 1, 2, 3
probit <- plor(y ~ x, data1, method='probit')
will get coefficients of level 2, 3 of x, but I want coefficients of level
1, 2
Thank you,
Tian
[[alternative HTML version deleted]]
2009 Jan 13
1
deviance in polr method
Dear all,
I've replicated the cheese tasting example on p175 of GLM's by McCullagh
and Nelder. This is a 4 treatment (rows) by 9 ordinal response (cols)
table.
Here's my simple code:
#### cheese
library(MASS)
options(contrasts = c("contr.treatment", "contr.poly"))
y = c(0,0, 1, 7, 8,8,19, 8,1, 6,9,12,11, 7,6, 1, 0,0, 1,1, 6, 8,23,7,
2005 Jun 10
1
problem with polr ?
I want to fit a multinomial model with logit link.
For example let this matrix to be analyzed:
male female aborted factor
10 12 1 1.2
14 14 4 1.3
15 12 3 1.4
(this is an example, not the true data which are far more complex...)
I suppose the correct function to analyze these data is polr from MASS library.
The data have been
2012 Mar 11
3
'Program Error' dialog box
I am running a windows executable, using wine, in a 'batch mode' - ie multiple times with different command parameters to the executable. For some parameters, the 'Program Error' dialog box appears and the wine process does not continue until the dialog box is closed. Is it possible to suppress the dialog box such that the entire batch can be completed without intervention?
2005 May 13
1
multinom(): likelihood of model?
Hi all,
I'm working on a multinomial (or "polytomous") logistic regression
using R and have made great progress using multinom() from the nnet
library. My response variable has three categories, and there are two
different possible predictors. I'd like to use the likelihoods of
certain models (ie, saturated, fitteds, and null) to calculate
Nagelkerke R-squared values for
2004 Oct 28
1
polr versus multinom
Hi,
I am searching for methods to compare regression models with an ordered
categorical response variable (polr versus multinom).
The pattern of predictions of both methods (using the same predictor
variables) is quite different and the AIC is smaller for the multinom
approach. I guess polr has more strict premises for the structure of the
response variable, which methods can be used to test for
2005 Jun 14
2
Logistic regression with more than two choices
Dear all R-users,
I am a new user of R and I am trying to build a discrete choice model (with
more than two alternatives A, B, C and D) using logistic regression. I have
data that describes the observed choice probabilities and some background
information. An example below describes the data:
Sex Age pr(A) pr(B) pr(C) pr(D) ...
1 11 0.5 0.5 0 0
1 40 1 0 0 0
0 34 0 0 0 1
0 64 0.1 0.5 0.2 0.2
...
2012 Jul 09
3
Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x'
Hello,
I am trying to run an ordinal logistic regression (polr) using the package
'MASS'.
I have successfully run other regression classes (glm, multinom) without
much problem, but with the 'polr' class I get the following error:
" Error in svd(X) : infinite or missing values in 'x' "
which appears when I run the "summary" command.
The data file is
2011 Jan 06
4
Different LLRs on multinomial logit models in R and SPSS
Hello, after calculating a multinomial logit regression on my data, I
compared the output to an output retrieved with SPSS 18 (Mac). The
coefficients appear to be the same, but the logLik (and therefore fit)
values differ widely. Why?
The regression in R:
set.seed(1234)
df <- data.frame(
"y"=factor(sample(LETTERS[1:3], 143, repl=T, prob=c(4, 1, 10))),
"a"=sample(1:5,
2004 May 05
4
Analysis of ordinal categorical data
Hi
I would like to analyse an ordinal categorical variable. I know how I can analyse a nominal categorical variable (with multinom or if there are only two levels with glm).
Does somebody know which command I need in R to analyse an ordinal categorical variable?
I want to describe the variable y with the variables x1,x2,x3 and x4. So my model looks like: y ~ x1+x2+x3+x4.
y: ordinal factor
2010 Dec 29
1
logistic regression with response 0,1
Dear Masters,
first I'd like to wish u all a great 2011 and happy holydays by now,
second (here it come the boring stuff) I have a question to which I hope u
would answer:
I run a logistic regression by glm(), on the following data type
(y1=1,x1=x1); (y2=0,x2=x2);......(yn=0,xn=xn), where the response (y) is
abinary outcome on 0,1 amd x is any explanatory variable (continuous or not)
2011 Apr 08
1
multinom() residual deviance
Running a binary logit model on the data
df <- data.frame(y=sample(letters[1:3], 100, repl=T),
x=rnorm(100))
reveals some residual deviance:
summary(glm(y ~ ., data=df, family=binomial("logit")))
However, running a multinomial model on that data (multinom, nnet)
reveals a residual deviance:
summary(multinom(y ~ ., data=df))
On page 203, the MASS book says that "here the
2006 Feb 22
2
does multinomial logistic model from multinom (nnet) has logLik?
I want to get the logLik to calculate McFadden.R2 ,ML.R2 and
Cragg.Uhler.R2, but the value from multinom does not have logLik.So my
quetion is : is logLik meaningful to multinomial logistic model from
multinom?If it does, how can I get it?
Thank you!
ps: I konw VGAM has function to get the multinomial logistic model
with logLik, but I prefer use the function from "official" R
2008 Jun 20
1
omnibus LR in multinomial model
If one estimates a model using multinom, is it possible to perform the
omnibus LR test ( the analogue to omnibus F in linear models ) using
the output
from multinom ? The residual deviance is there but I was hoping I could
somehow pull out the deviance based on just using an intercept ?
Sample code is below from the CAR book but I wasn't sure how to do it
based on that example. Thanks
2007 Feb 18
3
User defined split function in rpart
Dear R community,
I am trying to write my own user defined split function for rpart. I read
the example in the tests directory and I understand the general idea of the
how to implement user defined splitting functions. However, I am having
troubles with addressing the data frame used in calling rpart in my split
functions.
For example, in the evaluation function that is called once per node,