Displaying 20 results from an estimated 1000 matches similar to: "Error in contrasts message when using logistic regression code."
2011 Jan 27
2
Extrapolating values from a glm fit
Dear R-help,
I have fitted a glm logistic function to dichotomous forced choices
responses varying according to time interval between two stimulus. x values
are time separation in miliseconds, and the y values are proportion
responses for one of the stimulus. Now I am trying to extrapolate x values
for the y value (proportion) at .25, .5, and .75. I have tried several
predict parameters, and they
2017 Nov 11
1
effects package x axis labels
Dear All,
probably a simple enough solution but don;t seem to be able to get my head around it...example based on a publicly available data set:
mydata <- read.csv("https://stats.idre.ucla.edu/stat/data/binary.csv")
mylogit <- glm(admit ~ gre + gpa + rank, data = mydata, family = "binomial")
library(effects)
plot(allEffects(mylogit)
? ?
2017 Mar 22
3
GLM con clusters
Gracias a todos por sus respuestas, perdón si no fui muy claro.
Lo que intento replicar es un análisis realizado en Stata, tengo que hacer
los mismos cálculos pero en el r.
En Stata lo que se hizo fue:
xi: logistic i.coord i.v11_sexo, vce (cluster red)
*Vce (cluster clustvar) especifica que los errores estándar permiten la
correlación intragrupo, relajando el requisito habitual de que las
2012 Nov 08
3
Obtaining R-squared value in Logistic Regression
I do not see an R-squared value after preforming the glm regression.
Is there a separate command for this?
Thanks
--
View this message in context: http://r.789695.n4.nabble.com/Obtaining-R-squared-value-in-Logistic-Regression-tp4648954.html
Sent from the R help mailing list archive at Nabble.com.
2013 Apr 27
1
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
i am getting the following error
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
can any on e suggest how to rectify
[[alternative HTML version deleted]]
2017 Mar 22
3
GLM con clusters
Buenas tardes,
desde Uruguay, quiero realizar una regresión logística,con la función GLM,
pero ademas quiero designarle a las observaciones clusters.
La idea es decirle al programa que las observaciones corresponden a
diferentes clusters.
Saludos!
Sebastián.
[[alternative HTML version deleted]]
2007 Jun 28
2
logistic regression and dummy variable coding
Hello everyone,
I have a variable with several categories and I want to convert this
into dummy variables and do logistic regression on it. I used
model.matrix to create dummy variables but it always picked the
smallest one as the reference. For example,
model.matrix(~.,data=as.data.frame(letters[1:5]))
will code 'a' as '0 0 0 0'. But I want to code another category as
2012 May 11
3
Calculating all possible ratios
I have a data matrix with genes as columns and samples as rows. I want to
create all possible gene ratios.Is there an elegant and fast way to do it in
R and write it to a dataframe?
Thanks for any help.
Som.
--
View this message in context: http://r.789695.n4.nabble.com/Calculating-all-possible-ratios-tp4627405.html
Sent from the R help mailing list archive at Nabble.com.
[[alternative HTML
2012 Aug 14
1
Error; contrasts can be applied only to factors with 2 or more levels
Hi,
I have been running the same code without problem for the last few days,
changing data sets etc with no issue.
Today I changed the covariates for the model and am now getting this error
message:
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
Everything in the code looks the same to me, but I'm a
2012 Nov 04
1
Changing Date Variables as Continuous Variables
I am very new to R, so I apologize if this question is trivial.
I have a row in my data of dates in the format mm/dd/yyyy; about 3500 rows.
I am using this variable in a logistic regression model, and need to treat
it as continuous, not a factor as r has decided it is.
I tried the as.numeric function but it resulted in all NA's and the message:
"NAs introduced by coercion "
If
2009 Nov 14
1
setting contrasts for a logistic regression
Hi everyone,
I'm doing a logistic regression with an ordinal variable. I'd like to set
the contrasts on the ordinal variable. However, when I set the contrasts,
they work for ordinary linear regression (lm), but not logistic regression
(lrm):
ddist = datadist(bin.time, exp.loc)
options(datadist='ddist')
contrasts(exp.loc) = contr.treatment(3, base = 3, contrasts = TRUE)
lrm.loc =
2005 Jun 10
1
Yum/RPM Update Conflicts
Hi,
I've been trying to sort this out for the past week. I had a RedHat
7.3 desktop install with a disk dying on it. The desktop has two disks
on it - one configured with /, /usr and /boot (this was the bad disk)
and the second had /var and /home. I obtained a replacement disk and
initially tried copying the /, /usr and /boot filesystems to the new
disk but this ended up being a problem. In
2007 Jun 15
1
complex contrasts and logistic regression
Hi,
I am doing a retrospective analysis on a cohort from a designed trial,
and I am fitting
the model
fit<-glmD(survived ~ Covariate*Therapy + confounder,myDat,X=TRUE,
Y=TRUE, family=binomial())
My covariate has three levels ("A","B" and "C") and therapy has two
(treated and control), confounder is a continuous variable.
Also patients were randomized to
2012 Jun 21
4
crosstable and regression for survey data (weighted)
I have survey data that I am working on. I need to make some multi-way tables
and regression analyses on the data. After attaching the data, this is the
code I use for tables for four variables (sweight is the weight variable):
> a <- xtabs(sweight~research.area + gender + a2n2 + age)
> tmp <- ftable(a)
Is this correct? I don't think I need to use the strata and cluster
2005 Sep 13
1
possible bug in model.matrix
Is this a bug, or have I misunderstood the proper use of lm?
Thanks,
Whit
code:
x <- rnorm(50)
y <- matrix(as.logical(round(runif(100),0)),ncol=2)
NROW(x)==NROW(y)
lm(x~y)
> x <- rnorm(50)
> y <- matrix(as.logical(round(runif(100),0)),ncol=2)
> NROW(x)==NROW(y)
[1] TRUE
> lm(x~y)
Error in "[[<-.data.frame"(`*tmp*`, nn, value = c(2, 1, 2, 1, 1, 1, 2,
:
2012 Jul 25
1
error in running glm() function
m1.logit <-lm(default ~
amt.fac +
age.fac +
duration +
chk_acct +
history +
purpose +
sav_acct +
employment +
install_rate +
pstatus
2023 Jun 14
1
error en MANOVA
Muy buenas,
He usado muy poco R en mi vida, y ahora estoy intentando hacer una MANOVA,
con dos variables independientes (Edad, que tiene 4 niveles y Genero que
tiene 2) y 5 variables independientes. Le he puesto también que me haga el
poshoc de las dos y la interacción.
Decir también que me instalé el ULLRToolbox, que no se si tendrá algo que
ver con el error que me da.
Este es el código que uso
2023 Jun 14
1
error en MANOVA
Hola:
Probablemente está tomando 'Edad_Manova_18a54' y 'Genero2_1a2' como
variables numéricas (integer). Deberías convertirlas en factor. Por ejemplo:
Edad_Manova_18a54 <- factor(Edad_Manova_18a54)
Genero2_1a2 <- factor(Genero2_1a2)
Manova.fnc(datosPAS, variables=2:6,
fac.inter=c('Edad_Manova_18a54','Genero2_1a2'),poshoc=c('todos'))
Saludos,
2011 May 18
1
Need expert help with model.matrix
Dear experts:
Is it possible to create a new function based
on stats:::model.matrix.default so that an alternative factor coding is used
when the function is called instead of the default factor coding?
Basically, I'd like to reproduce the results in 'mat' below, without having
to explicitly specify my desired factor coding (identity matrices) in the
'contrasts.arg'.
dd
2019 Aug 31
0
inconsistent handling of factor, character, and logical predictors in lm()
Dear Bill,
Thanks for pointing this difference out -- I was unaware of it.
I think that the difference occurs in model.matrix.default(), which coerces character variables but not logical variables to factors. Later it treats both factors and logical variables as "factors" in that it applies contrasts to both, but unused factor levels are dropped while an unused logical level is not.
I