Displaying 20 results from an estimated 6000 matches similar to: "data frame to frequencies"
2012 May 12
1
categorical analysis - grouping rows
I apologize up front if this has been covered elsewhere - but I can't find
any such question.
I have a data set that contains academic data: term (i.e., semester),
student id, dept, class, success (1=Y, 0=N)
I want to look at dept by term to determine descriptive statistics for
success to failure ratios. The intent being to discover if there are
departments that contribute significantly to
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
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,
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
2006 Jun 30
2
has_many through - getting the parent
has_many :through is great. Is there anyway to find the association
that it went through?
Example:
class Student
has_many :projects
has_many :grades, :through => :projects
end
student.grades[3].project
Is it clear what I''m asking? How would this be done?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 20
3
has_many :through with has_many/has_many join models
It seems that using a join model that joins with two has_many''s will
fail to generate proper SQL
class StudentSemesterRecord < ActiveRecord::Base
belongs_to :semester
has_many :discipline_records, :through => :semester
end
class Semester < ActiveRecord::Base
has_many :student_semester_records
has_many :discipline_records
end
class DisciplineRecord <
2005 Dec 02
3
plot and factors
Read R-helpers,
I'm relatively new to R and trying to jump in feet first. I've been
able to learn a lot from on-line and printed documentation, but
here's one question to which I can't find an answer. Well, it's a
question with a couple parts. Thanks in advance for any direction
(partial or complete) that anyone can provide.
I have a data frame with three columns:
2024 Feb 22
1
Extracting Plot Arguments
Hi All,
I'm building an autograding framework for my biostatistics class this
semester, and I am exploring different ways to automatically grade
figures.
In other classes, I teach ggplot2 and I extract information directly
from the ggplot2 object. However, in this class we are using base R
and I need to extract information from base-r graphics.
I've tried several different approaches,
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 28
1
paste command
In a previous post, I mentioned a loop being used to generate graphs. I have some sample code partially put together but have found one offending line of code that I cannot figure out what to do with.
I have one data frame called grade4. If I do something like
hist(grade4$math)
I get the appropriate chart.
Within the loop, however, I am doing this for multiple files and grades, so I use
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
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
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,
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
2005 Dec 05
1
data frames, na.omit, and sums
Dear R-helpers,
New to R, I'm in the middle of a project that I'm using to force me
learn R. I'm running into some behavior that I don't understand, and
I need some advice. In the last week I've gotten some great advice
from the list on visualizing my data, and I was hoping people could
help me get over another barrier I've encountered to my progress.
Before I
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
2009 Mar 06
9
Association broken when upgrading from rails 1.2.6 to 2.2.2
I have an app with the following models:
course
belongs_to :semester
semester
has_many: courses
belongs_to :education
education
has_many :semesters
In my old app (rails 1.2.6) I was able to access variables via
controller
@courses = Course.find(:all)
view file:
<% for course in @courses %>
<%= course.name %> <- this line works
<%= course.semester.name %> <- this is now