Displaying 20 results from an estimated 2000 matches similar to: "Factor level with no cases shows up in a plot"
2009 Apr 17
0
Mischief on legend when size=1 added to geom_line
Hi Arthur:
# Just move size outside 'aes' like this:
p <- ggplot(df1, aes(Year, PctProf, group = Group))
p + geom_line(aes(color = Group),size=1)
# to make the background white just use the black and white theme:
p <- ggplot(df1, aes(Year, PctProf, group = Group))
p + geom_line(aes(color = Group),size=1) + theme_bw()
Felipe D. Carrillo
Supervisory Fishery Biologist
Department
2009 Jan 07
2
New York Times Article: Data Analysts Captivated by R's Power
Readers of this list might be interested in the following article in the
New York Times and might find amusing the notion that "Some people
familiar with R describe it as a supercharged version of Microsoft's
Excel spreadsheet software...".
http://www.nytimes.com/2009/01/07/technology/business-computing/07progra
m.html?_r=1&ref=technology
Art
2009 Dec 09
2
Problem with if statement
I am trying to use the value of an ID variable in an if statement and
not getting the results I expected.
# ID values for two school districts
> with(rf, tapply(DistrictID, DistrictName, min) )
Aberdeen School Dist. # 58 Buhl Joint School District
59340 53409
This creates DNAME as I expected ...
2009 Jun 01
1
installing sn package
Hi r-users,
I want to use the sn package but I got the following message:
> install.packages(repos=NULL,pkgs="c:\\Tinn-R\\sn_0.4-12.zip")
Warning: package 'sn' is in use and will not be installed
updating HTML package descriptions
I did tried to do it a few times but it gives the same message.
________________________________
From:
2009 May 31
1
R Solves Shakespeare Authorship Question
Those of you who track applications of R may be interested in the following:
"The purpose of this paper is then to apply modern
text analysis techniques using the R statistical packege [sic]
to compare the works attributed to Shakespeare
to those of leading alternate candidates such as Sir
Frances Bacon, Christopher Marlow, and Edward de
Vere...".
2012 May 04
2
Binomial GLM, chisq.test, or?
Hi,
I have a data set with 999 observations, for each of them I have data on
four variables:
site, colony, gender (quite a few NA values), and cohort.
This is how the data set looks like:
> str(dispersal)
'data.frame': 999 obs. of 4 variables:
$ site : Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 2 2 ...
$ gender: Factor w/ 2 levels "0","1":
2012 Jun 04
1
Chi square value of anova(binomialglmnull, binomglmmod, test="Chisq")
Hi all,
I have done a backward stepwise selection on a full binomial GLM where the
response variable is gender.
At the end of the selection I have found one model with only one explanatory
variable (cohort, factor variable with 10 levels).
I want to test the significance of the variable "cohort" that, I believe, is
the same as the significance of this selected model:
>
2012 May 07
1
Can't find the error in a Binomial GLM I am doing, please help
Hi all,
I can't find the error in the binomial GLM I have done. I want to use that
because there are more than one explanatory variables (all categorical) and
a binary response variable.
This is how my data set looks like:
> str(data)
'data.frame': 1004 obs. of 5 variables:
$ site : int 0 0 0 0 0 0 0 0 0 0 ...
$ sex : Factor w/ 2 levels "0","1": NA NA NA
2011 Aug 06
1
help with predict for cr model using rms package
Dear list,
I'm currently trying to use the rms package to get predicted ordinal
responses from a conditional ratio model. As you will see below, my
model seems to fit well to the data, however, I'm having trouble
getting predicted mean (or fitted) ordinal response values using the
predict function. I have a feeling I'm missing something simple,
however I haven't been able to
2007 Aug 02
1
Xyplot - adding model lines to plotted points
Hello,
I have written code to plot an xyplot as follows:
library(lattice)
xyplot(len~ageJan1|as.factor(cohort),groups=sex,as.table=T,strip=strip.c
ustom(bg='white',fg='white'),data=dat,
xlab="Age (January 1st)",ylab="Length (cm)",main="Linear models for male
and female cod, by cohort",type='p',
2008 Jun 16
1
回复: cch() and coxph() for case-cohort
I tried to compare if cch() and coxph() can generate same result for
same case cohort data
Use the standard data in cch(): nwtco
Since in cch contains the cohort size=4028, while ccoh.data size =1154
after selection, but coxph does not contain info of cohort size=4028.
The rough estimate between coxph() and cch() is same, but the lower
and upper CI and P-value are a little different. Can we
2011 Jun 28
2
coxph() - unexpected result using Crawley's seedlings data (The R Book)
Hi,
I ran the example on pp. 799-800 from Machael Crawley's "The R Book" using package survival v. 2.36-5, R 2.13.0 and RStudio 0.94.83. The model is a Cox's Proportional Hazards model. The result was quite different compared to the R Book. I have compared my code to the code in the book but can not find any differences in the function call. My results are attached as well as a
2008 Jun 12
1
cch function and time dependent covariates
----- begin included message
In case cohort study, we can fit proportional hazard regression model to
case-cohort data. In R, the function is cch() in Survival package
Now I am working on case cohort analysis with time dependent covariates
using cch() of "Survival" R package. I wonder if cch() provide this utility
or not?
The cch() manual does not say if time dependent covariate is
2010 Feb 12
1
using mle2 for multinomial model optimization
Hi there
I'm trying to find the mle fo a multinomial model ->*L(N,h,S?x)*. There
is only *N* I want to estimate, which is used in the number of successes
for the last cell probability. These successes are given by:
p^(N-x1-x2-...xi)
All the other parameters (i.e. h and S) I know from somewhere else.
Here is what I've tried to do so far for a imaginary data set:
2003 Dec 05
3
Odds ratios for categorical variable
Dear R-users:
How does one calculate in R the odds ratios for a CATEGORICAL predictor
variable that has 4 levels. I see r-help inquiries regarding odds ratios
for what looked like a continuous predictor variable. I was wondering how
to get the pairwise odds ratios for comparisons of levels of a categorical
predictor variable. I can't seem to get the correct output using:
>
2003 Mar 24
1
APC Modelling and the GLM function
Hi all
Apologies for any cross posting.
I have encountered a rather bizarre "problem" in Splus and R. I am using Age-Period-Cohort models to model cervical cancer and have run the same data
on both R (v.1.4.1 & v1.6.2) and Splus (version 6.0). I used the same command line in both Splus and R: glm(cases~-1+as.factor(age)
2012 Oct 06
2
Expected number of events, Andersen-Gill model fit via coxph in package survival
Hello,
I am interested in producing the expected number of events, in a
recurring events setting. I am using the Andersen-Gill model, as fit
by the function "coxph" in the package "survival."
I need to produce expected numbers of events for a cohort,
cumulatively, at several fixed times. My ultimate goal is: To fit an
AG model to a reference sample, then use that fitted model
2004 Oct 11
3
split and rlm
Hello, I'm trying to do a little rlm of some data that looks like this:
UNIT COHORT perdo adjodds
1010 96 0.39890 1.06894
1010 97 0.48113 1.57500
1010 98 0.36328 1.21498
1010 99 0.44391 1.38608
It works fine like this: rlm(perdo ~ COHORT, psi=psisquare)
But the problem is that I have about 100 UNITs, and I want to do a
2013 Aug 23
1
A couple of questions regarding the survival:::cch function
Dear all,
I have a couple of questions regarding the survival:::cch function.
1) I notice that Prentice and Self-Prentice functions are giving identical standard errors (not by chance but by programming design) while their estimates are different. My guess is they are both using the standard error form from Self and Prentice (1986). I see that standard errors for both methods are
2011 May 17
1
epi.2by2
This is a really simple question, I'm sure,but I can't make EpiR work!
I keep getting the following:
> epi.2by2(47, 263483, 282, 935028, method="cohort.time", conf.level=0.95)
Error in epi.2by2(47, 263483, 282, 935028, method = "cohort.time",
conf.level = 0.95) :
unused argument(s) (935028)
and I really don't know why!. Any ideas very very welcome
thank