Displaying 20 results from an estimated 37 matches for "cddesjardin".
Did you mean:
cddesjardins
2009 Mar 12
3
Unable to run smoother in qplot() or ggplot() - complains about knots
I get the following error when I run qplot()
qplot(grade, read,data = hhm.long.m, geom = c("point", "smooth"))
Error in smooth.construct.cr.smooth.spec(object, data, knots) :
x has insufficient unique values to support 10 knots: reduce k.
I am not sure how to tackle this problem. When I take a subsample (<
1000) than I am able to run that function but with my sample
2010 Jul 22
2
Multilevel survival model
.... How might I do this in R? Can I do it with the survival
library? If possible, I'd also like to control for sex.
Thanks,
Chris
--
Christopher David Desjardins
PhD student, Quantitative Methods in Education
MS student, Statistics
University of Minnesota
192 Education Sciences Building
http://cddesjardins.wordpress.com
2012 Jul 17
3
Finding the column with the maximum value by row
Hi,
Let's say I have the following data:
> a=matrix(c(1,2,4,4,2,1,1,2,4),nrow=3,byrow=T)
> a
[,1] [,2] [,3]
[1,] 1 2 4
[2,] 4 2 1
[3,] 1 2 4
What syntax should I use to get R to tell me the column that corresponds to
the maximum value for each row?
For my example, I would like to get a vector that says 3, 1, 3 because the
maximum value for row 1 is
2011 Jun 23
2
Merging multiple data sets
Hi,
I am trying to merge data similar to the example data below
> dat0
id var1 var2 var3
2 1 0 1
3 1 0 1
4 0 1 1
5 0 1 1
> dat1
id var4 var5 var6
2 1 0 1
3 1 0 1
6 0 1 1
7 0 1 1
> dat2
id
2010 Jul 23
1
Survival analysis MLE gives NA or enormous standard errors
...l using
priors to overcome the lack of a mixed response?
Also, please cc me on an email as I am a digest subscriber.
Thanks,
Chris
--
Christopher David Desjardins
PhD student, Quantitative Methods in Education
MS student, Statistics
University of Minnesota
192 Education Sciences Building
http://cddesjardins.wordpress.com
2012 Apr 09
3
For loops
Hi,
I am having trouble with syntax for a for loop. Here is what I am trying to
do.
class=c(rep(1,3),rep(2,3),rep(3,3))
out1=rnorm(length(class))
out2=rnorm(length(class))
out3=rnorm(length(class))
data=data.frame(class,out1,out2,out3)
dat.split=split(data,data$class)
for(i in 1:3){
sub[i]=dat.split[i]
}
However, the for loop doesn't work. I want to assign each split to a
different
2011 Mar 30
6
Quick recode of -999 to NA in R
Hi,
I am trying to write a loop to recode my data from -999 to NA in R. What's
the most efficient way to do this? Below is what I'm presently doing, which
is inefficient. Thanks,
Chris
dat0 <- read.table("time1.dat")
colnames(dat0) <- c("e1dq", "e1arcp", "e1dev", "s1prcp", "s1nrcp", "s1ints",
2009 Jun 28
1
ggplot2 x axis question
Hi,
I have 45 models that I have named: 1, 2, 3, ... , 45 and I am trying to
plot them in order of ascending BIC values. I am however unclear as to
how I can get the models to line up on the x-axis by BIC and not by
numeric order. For example, if model 5 has a lower BIC than 1, I want it
to be the first point on the left hand side of the curve. This seems to
work in plot:
plot(1:45,
2010 May 13
1
Questions about ggplot2
Hi I have two questions about using ggplot2.
First, I have multiple columns of data that I would like to combine into
one histogram where each column of data would correspond to one bar in
the histogram. Each column has 0 or 1s and I want my bars in the
histogram to correspond to the sum of the 1s in each column. Does that
make sense?
Second, is there a way to completely turn off the legend?
2009 Jun 28
1
ggplot2 x axis question
Hi,
I have 45 models that I have named: 1, 2, 3, ... , 45 and I am trying to
plot them in order of ascending BIC values. I am however unclear as to
how I can get the models to line up on the x-axis by BIC and not by
numeric order. For example, if model 5 has a lower BIC than 1, I want it
to be the first point on the left hand side of the curve. This seems to
work in plot:
plot(1:45,
2012 Sep 21
1
New Submission to CRAN note
Hi,
I want to submit a package to CRAN and I am getting the following Note:
* checking CRAN incoming feasibility ... NOTE
New submission
How can I take care of this? And/or is it a big deal?
Thanks and sorry if this is something that I easily overlooked I have
googled this topic for a while and found nothing.
Chris
[[alternative HTML version deleted]]
2011 Aug 04
1
Plotting just a portion of a smoother graph in ggplot2
Hi,
I am using ggplot2 to with the following code:
gmathk2 <-
qplot(time,math,colour=Kids,data=kids.ach.lm.k5,geom="smooth",method="lm",formula=y~ns(x,1))
+ opts(title="Smoother Plot: Math K-5") + xlab("Time") + ylab("Math") +
scale_colour_brewer(pal="Set1"); gmathk2
This plots all the smoother for all the x values. What I'd like
2012 Jul 20
2
Changing ungrouped cases to grouped cases
Hi,
I have my data the following way:
y A B C
0 1 1 2
0 1 2 1
1 1 1 2
0 1 1 2
1 1 1 2
1 1 2 1
0 1 2 2
.
.
.
And so on. How can I make my data look like the following:
y A B C
2 1 1 2
1 1 2 1
0 1 2 2
.
.
.
In other words how can I change my ungrouped cases into grouped cases?
Thanks!
Chris
[[alternative
2013 Feb 04
1
Combining data from different saved files with same object names into one data frame
Hi,
I am simulating data from a zero-inflated negative binomial model. I have 4
different conditions and I've saved various information about the models in
zinbsumbstat-jklm.rdata (as shown below). What I want to do is print
information from each of these *.rdata and store them in one large object
(a matrix or a data frame). However, within each data the objects all have
the same name. So I
2009 Mar 19
2
Randomly splitting a data frame in half
I have a data frame in long format and I would like to randomly divide
this data frame in half. The data frame consists of 39622 rows and I
initially tried ...
randomsample1 <- data[sample(nrow(data),19811), ]
Where allows me to randomly select half of the rows and assign them to
randomsample1 but then I couldn't figure out how to select those rows
that were not selected and assign
2010 Jul 27
0
AIC from coxme
...Surv numeric
call 3 -none- call
ties 1 -none- character
--
Christopher David Desjardins
PhD student, Quantitative Methods in Education
MS student, Statistics
University of Minnesota
192 Education Sciences Building
http://cddesjardins.wordpress.com
2010 May 28
3
Gelman 2006 half-Cauchy distribution
Hi,
I am trying to recreate the right graph on page 524 of Gelman's 2006
paper "Prior distributions for variance parameters in hierarchical
models" in Bayesian Analysis, 3, 515-533. I am only interested, however,
in recreating the portion of the graph for the overlain prior density
for the half-Cauchy with scale 25 and not the posterior distribution.
However, when I try:
2011 Mar 29
4
Creating 3 vectors that sum to 1
I have 3 vectors: p1, p2, and p3. I would like each vector to be any
possible value between 0 and 1 and p1 + p2 + p3 = 1. I want to graph these
and I've thought about using scatterplot3d(). Here's what I have so far.
library(scatterplot3d)
p1 <- c(1,0,0,.5,.5,0,.5,.25,.25,.34,.33,.33,.8,.1,.1,.9,.05,.05)
p2 <- c(0,1,0,.5,0,.5,.25,.5,.25,.33,.34,.33,.1,.8,.1,.05,.9,.05)
p3 <-
2012 Nov 03
2
Replacing NAs in long format
Hi,
I have the following data:
> data[1:20,c(1,2,20)]
idr schyear year
1 8 0
1 9 1
1 10 NA
2 4 NA
2 5 -1
2 6 0
2 7 1
2 8 2
2 9 3
2 10 4
2 11 NA
2 12 6
3 4 NA
3 5 -2
3 6 -1
3 7 0
3 8 1
3 9 2
3 10 3
3 11 NA
What I want to do is
2011 Apr 06
3
Getting number of students with zeroes in long format
Hi,
I have longitudinal school suspension data on students. I would like to
figure out how many students (id_r) have no suspensions (sus), i.e. have a
code of '0'. My data is in long format and the first 20 records look like
the following:
> suslm[1:20,c(1,7)]
id_r sus
11 0
15 10
16 0
18 0
19 0
19 0
20 0
21 0
21 0
22 0
24 0
24