Displaying 20 results from an estimated 20000 matches similar to: "regression with categorical nuisance variable"
2011 Oct 18
1
nuisance variables
*Dear experts,*
Please excuse me for disturbing... Right now I am struggling with GLM a
bit... Would you be so kind to provide me a solution on using nuisance
variables. The problem is that I have data on Depression (volumetric
measurements of different brain regions) and I want to include age, gender
and education as nuisance parameters in the model. In the other words I
would like to model the
2012 Sep 05
2
Recoding categorical gender variable into numeric factors
I currently have a data set in which gender is inputed as "Male" and "Female"
, and I'm trying to convert this into "1" and "0".
I found a website which reccomended using two commands:
data$scode[data$sex=="M"] <- "1"
data$scode[data$sex=="F"] <- "2"
to convert to numbers, and:
data$scode <-
2010 Oct 20
1
Please help: ANOVA with SS Type III for unequal sample sized data
Dear R experts,
I'm beginner.
My question about ANOVA for unequal sample sized data should be obsolete but
I can not clarify it.
I have a dataset from 23 males and 18 females.
I measured one condition('cond') with 4 levels.
So I'd like to see main effect of gender, cond and gender by cond
interaction and also postHoc test. (In fact, I have to do anova 90 times)
*
1. Question
2008 Nov 11
1
using newdata in survfit with categorical variable
Hi R-helpers,
I was trying to put gender='Male' in newdata to create a expected survival curve for a pseudo cohort by using survfit based on Cox regression. My codes are shown below:
fit<- coxph(Surv(end, status2)~gender, data=wlwsn1)
Summary(fit)
coef exp(coef) se(coef) z p
genderMale 0.204 1.23 0.0912 2.23 0.025
2008 Apr 03
2
coding for categorical variables with unequal observations
Hi,
I am doing multiple regression, and have several X variables that are
categorical.
I read that I can use dummy or contrast codes for that, but are there
any special rules when there're unequal #observations in each groups (4
females vs 7 males in a "gender" variable)?
Also, can R generate these codes for me?
THanks.
2011 Jun 02
0
Nuisance parameters
Dear R-experts,
Please, excuse me for disturbing... I tried to find the answer to my
question in archives without any result...
I assume, this is going to look like a stupid question... I have dataset of
different brain structures within two groups of subjects. But unfortunately
these groups are not matched by age and gender. Would you be so kind to
suggest me how (using which formula) can I
2016 Apr 17
0
Bug in by() function which works for some FUN argument and does not work for others
> On Apr 16, 2016, at 2:03 AM, Akhilesh Singh <akhileshsingh.igkv at gmail.com> wrote:
>
> Dear All,
>
> I have got your core message, that it is my responsibility to determine whether any particular function in my version of R satisfies the language requirements at the time of your use. Jim Albert and Maria Rizzo must have used their code, which was permitted in the R-code
2016 Apr 16
2
Bug in by() function which works for some FUN argument and does not work for others
Dear All,
I have got your core message, that it is my responsibility to determine
whether any particular function in my version of R satisfies the language
requirements at the time of your use. Jim Albert and Maria Rizzo must have
used their code, which was permitted in the R-code of their time (2012).
Therefore, I have now modified my R-code, as per R-3..2.4 version,
according to my requirement
2010 Sep 04
3
Levels in returned data.frame after subset
Dear List,
When I subset a data.frame, the levels are not re-adjusted (see
example). Why is this? Am I missing out on some basic stuff here?
Thanks
Ulrik
> m <- data.frame(gender = c("M", "M","F"), ht = c(172, 186.5, 165), wt = c(91,99, 74))
> dim(m)
[1] 3 3
> levels(m$gender)
[1] "F" "M"
> s <- subset(m, m$gender ==
2010 Jan 21
1
Simple effects with Design / rms ols() function
Hi everyone,
I'm having some difficulty getting "simple effects" for the ols()
function in the rms package. The example below illustrates my
difficulty -- I'll be grateful for any help.
#make up some data
exD <- structure(list(Gender = structure(c(1L, 2L, 1L, 2L, 1L, 1L, 1L,
2L, 1L, 2L, 2L, 2L, 1L, 2L), .Label = c("F", "M"), class = "factor"),
2016 Apr 15
0
Bug in by() function which works for some FUN argument and does not work for others
> On Apr 15, 2016, at 1:16 AM, Akhilesh Singh <akhileshsingh.igkv at gmail.com> wrote:
>
> Dear All,
>
> Thanks for your help. However, I would like to draw your attention to the
> following:
>
> Actually, I was replicating the Example 2.3, using the dataset
> "brainsize.txt" given in Section 2.3.3 ("Summarize by group") at page 55,
> of a
2004 Dec 16
1
help with multiple imputation using imp.mix
I am desperately trying to impute missing data using 'imp.mix' but always
run into this yucky error message to which I cannot find the solution. It's
the first time I am using mix and I'm trying really hard to understand, but
there's just this one step I don't get...perhaps someone knows the answer?
Thanks!
Jens
My code runs:
2016 Apr 15
4
Bug in by() function which works for some FUN argument and does not work for others
Dear All,
Thanks for your help. However, I would like to draw your attention to the
following:
Actually, I was replicating the Example 2.3, using the dataset
"brainsize.txt" given in Section 2.3.3 ("Summarize by group") at page 55,
of a famous book "R by Example" written by "Jim Albert and Maria Rizzo"
published in Springers (2012) in a Use R! Series. The
2008 May 04
4
improvement of Ancova analysis
Dear Helpers,
I just started working with R and I'm a bit overloaded with information.
My data is from marsupials reindroduced in a area. I have weight(wt),
hind foot
lenghts(pes) as continues variables and origin and gender as categorial.
condition is just the residuals i took from the model.
> names(dat1)
[1] "wt" "pes" "origin" "gender"
2009 Sep 08
2
Very basic question regarding plot.Design...
Hello ALL!
I have a problem to plot factor (lets say gender) as a line, or at least
both line and point, from ols model:
ols1 <- ols(Y ~ gender, data=dat, x=T, y=T)
plot(ols1, gender=NA, xlab="gender", ylab="Y",
ylim=c(5,30), conf.int=FALSE)
If I convert gender into discrete numeric predictor, and use
forceLines=TRUE, plot is not nice and true, since it shows values
2003 Aug 22
2
"subscript out of range" message
Hi All:
I was recently working with a dataset on arsenic poisoning. Among the
variables in the dataset, I used the following three variables to produce
crosstabulations (variable names: FOLSTAT, GENDER, ASBIN; all three were
categorical variables, FOLSTAT denoted follow up status for the subjects and
had seven levels, GENDER denoted sex (two levels: male,female), and ASBIN
denoted binarized
2011 May 26
2
matching by gender and age
Hello R gurus, I have a data set from which i have to extract the gender and
age matched rows from controls and disease group
disease<-paste(rep(c('y','n'),11))
gender<-paste(rep(c('m','f'),11))
mcp<-rnorm(700,1400)
age<-rnorm(32,34)
dat<-data.frame(disease=disease,sex=gender,Dr_age=age[1:22],MCP=mcp[1:22])
I have other categorical variables also to
2004 Jun 22
3
Regression Modeling query
Hi All
I received a raw data set with one record per tennis player (both male and
female) and then i cured it by aggregation i.e by 4 age groups, 2 gender
levels and 6 income levels. Gender and Income are categorical variables.
Please advise me how to use 'R' to model this data set (Actually, i want to
know the right regression technique and steps to do that, including removing
2012 Jan 24
0
spaghetti plot - categorical variable differentiated by color
Hello,
I am trying to create individual concentration-time spaghetti plots sorted
by dose, and within each dose to show two different colors for a
categorical variable (gender). I can’t find a way to add the color for
gender. Groups=ID enables individual lines for each subject. If I use
groups=gender, there will be two colors, but the lines between subjects are
connected.
This is what I have
2011 Nov 10
2
Listing tables together from random samples from a generated population?
.
HI there,
I'd like to show demonstrate how the chi-squared distribution works, so I've come up with a sample data frame of two categorical variables
y<-data.frame(gender=sample(c('Male', 'Female'), size=100000, replace=TRUE, c(0.5, 0.5)), tea=sample(c('Yes', 'No'), size=100000, replace=TRUE, c(0.5, 0.5)))
And I'd like to create a list of 100