Displaying 20 results from an estimated 10000 matches similar to: "paste command"
2004 Nov 28
1
Modifications to an abline
Dear List:
I am working to generate graphs for individual students that will be created through a series of loops in Sweave. Before doing so, I am still trying to design the graph. The code for creating the barplot is below with some sample datapoints just made up for now.
Ultimately, this chart will take data from an lme object using longitudinal student data. So, the dots represent the
2006 Mar 29
1
Lmer BLUPS: was(lmer multilevel)
Paul:
I may have found the issue (which is similar to your conclusion). I
checked using egsingle in the mlmRev package as these individuals are
strictly nested in this case:
library(mlmRev)
library(nlme)
fm1 <- lme(math ~ year, random=~1|schoolid/childid, egsingle)
fm2 <- lmer(math ~ year +(1|schoolid:childid) + (1|schoolid), egsingle)
Checking the summary of both models, the output is
2004 Jul 02
1
Problem in lme4
Dear List:
I was able to run the following in nlme successfully, but the same model
and code (same dataset) failed to run in lme4 and gave me the error
message below. Any thoughts?
lme(math~year, data=egsingle, random=~year|schoolid/childid)
Error in lme(formula = math ~ year, data = egsingle, random =
structure(list( :
Unable to invert singular factor of downdated X'X
2005 Aug 24
2
Remove NAs from Barplot
Dear List:
I'm creating a series of barplots using Sweave that must assume a
standard format. This is student achievement data and the x-axis must
include all grades 3 to 8. In some cases, the data for a grade (or more
than one grade) are missing in the vector math.bar, but are never
missing for the vector apmxpmeet. The following sample code illustrates
the issue.
Using the code below to
2004 Aug 06
1
Comparing rows in a dataframe
Hello
I have a longitudinal dataframe organized in the long format and would like to make comparison between successive rows if certain conditions apply. Specifically, I have four variables of interest: grade, score, year, and schid, associated with each school with 3 measurements per school per grade, therefore the rows are temporally ordered and each school occupies multiple rows. For example,
2006 Oct 20
1
Translating lme code into lmer was: Mixed effect model in R
This question comes up periodically, probably enough to give it a proper
thread and maybe point to this thread for reference (similar to the
'conservative anova' thread not too long ago).
Moving from lme syntax, which is the function found in the nlme package,
to lmer syntax (found in lme4) is not too difficult. It is probably
useful to first explain what the differences are between the
2010 Feb 28
3
Change the scale on a barplot's y axis
I have grades data. I read them from a csv in letter-grade format. I
then converted them to levels
levels(grades$grade)=c('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-')
And then to numbers
grades$gp=grades$grade
levels(grades$gp)=c(4.3,4.0,3.7, 3.3,3.0,2.7, 2.3,2.0,1.7, 1.3,1.0,0.7)
2006 Apr 14
2
spot the error (I can''t, I''m new)
I have a form that I want to use to update multiple
objects. In the controller,
@grades = Grade.find(params[:grade].keys)
@grades.each_with_index do |grade, i|
grade.update_attribute(params[:grade][i])
end
all_valid = @grades.inject(true) {|memo, c|
c.valid? && memo }
this doesn''t update the attributes as I would expect.
(I would just use
2010 Oct 29
2
wilcox.test; data type conversion?
I'm working on a quick tutorial for my students, and was planning on
using Mann-Whitney U as one of the tests.
I have the following (fake) data
grade <- c("MVG", "VG", "VG", "G", "MVG", "G", "VG", "G", "VG")
sex <- c( "male", "male", "female", "male",
2013 Jun 03
1
Multiple selection and normalization
Hi--
I am trying to normalize course grades for each instance of a course, e.g.
Stats 1 Fall2009 J. Smith.
I have a frame for all instances of a course, e.g. stats 1 in the last 5
years, that looks like
SIDN TERM GRADE INST
where SIDN is a Student ID Number, TERM is a factor that gives the quarter
and year a course was offered, GRADE is a 0-4.3 grade and INST is the
instructor, again as a
2011 Aug 16
1
Repeated measures cummulative logit mixed model
Dear R help gurus,
I have the following problem and I would be delighted if you could help me.
>From a large (1500) cohort of patients we have been taking some measurements
(ECG measurements, but its not important). The measurements are ordinal in 4
grades (Grade I-IV, grade IV being the most severe form). Every patients has
been measured several times (usually once per year). The
2003 Mar 24
2
Box Plot Question
I would like to create 15 box plots from two sets of data.
Set1 - containts PayGrade, Min_Salary, Max_Salary data for 15 pay grades
Set2 - contains PayGrade, Actual_Min, Actual_Max, and Actual_Mean for the 15
pay grades
I would like 15 box plots (one for each paygrade) whose whiskers were the
Min_Salary and Max_Salary data
and whose ''box'' was Actual_Min, Actual_Mean,
2009 Apr 11
1
Error in R CMD check 2.8.1
Env: R 2.8.1, Win Xp, Eclipse/StatET
In a .Rd file, I have an example containing the lines:
# calculate Y M, using polynomial contrasts
trends <- as.matrix(VocabGrowth) %*% poly(8:11, degree=3)
colnames(trends)<- c("Linear", "Quad", "Cubic")
[At the risk of a long message, I'll append the complete .Rd file at the
end of this message, in case this was
2004 Nov 17
1
"Impossible to run" error message when using Sweave
Dear List:
I have a large dataset of multiple schools. My goal is to produce a
separate tex file for each school that plots some of the student
achievement scores. Essentially, the aim is to develop a custom report
for each school. To accomplish this, I have code for a loop that gets
sourced into R and then Sweaves the multiple files to create the
individual school reports.
Here is the code for
2004 Aug 01
3
Creating dummy codes
Is there an efficient way to create a series of dummy codes from a single variable? For example, I have a variable, “grade” = {2, …, 12}. I want to create k-1 dummy codes for grade such that grade 2 is the base (i.e, grade 2 =0).
I am hoping that the new variables can be labeled as grade.3, grade.4 etc. I'll then use
grade <- paste("grade.", 3:12, sep="") in
2004 Aug 03
2
attach data from tapply to dataframe
I am working with a longitudinal data set in the long format. This data
set has three observations per grade level per year. Here are the first
10 rows of the data frame:
>tenn.dat[1:10,]
year schid type grade gain se new cohort
6 2001 100005 5 4 33.1 3.5 4 3
7 2002 100005 5 4 33.9 3.9 4 2
8 2003 100005 5 4 32.3 4.2 4 1
10 2001 100005
2001 Jan 05
1
Trends for many units
I have data on every grade in all elementary schools in Chicago over 5 years. I
would like to estimate a trend over time for each grade in each school. There
are 17,600 data all together (about 460 schools, nearly 8 grades each, over 5
years). Is there a not-so-hard way to do this in R (I was thinking of using
rlm)?
______________________________________________________________________
Stuart
2010 Jun 28
2
Lattice and Beamer
Two things I think are some of the best developments in statistics and production are the lattice package and the beamer class for presentation in Latex. One thing I have not become very good at is properly sizing my visuals to look good in a presentation.
For instance, I have the following code that creates a nice plot (sorry, cannot provide reproducible data).
2015 Jul 13
2
Crear datos aleatorios con restriciones
Hola,
Esta pregunta la hice en stackoverflow
<http://stackoverflow.com/questions/31137940/randomly-assign-teachers-to-classrooms-imposing-restrictions/31143808#31143808>pero
nadie pudo contestarla.
1. Quiero generar N escuelas, con G grados y C divisiones.
2. Quiero asignar cada uno de T maestros a 2 divisiones en un grado y
escuela
Si tengo C=4 divisiones, puedo lograr lo que quiero con
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