similar to: How to filter a data frame?

Displaying 20 results from an estimated 3000 matches similar to: "How to filter a data frame?"

2008 Jun 05
2
how to get the distribution curve from a data set?
I have a question. I have a data set (about 100,000 observations). How would I get the distribution curve graph? This is like, if I use hist(x, freq="TRUE", breaks=1000) to get the histogram, now the question is, I don't need the histogram itself, I just need the curve that connects the top of each histogram bin. Thank you very much! -- View this message in context:
2008 Jul 07
3
A quick question about lm()
I have a simple regression using lm(). If I just want to check the coefficient, I can use summary(lm())$coef; if I need the standard error, I can use summary(lm())$s, if I need the residuals, I can use summary(lm())$res. OK. How can I get the R-squares and Adjusted R-squares using $...? Is there a function, like objects(), that can show all the references for values? Thanks a lot! -- View this
2011 Nov 03
2
query about counting rows of a dataframe
Dear R users, I have got the following data frame, called my_df: gender day_birth month_birth year_birth labour 1 F 22 10 2001 1 2 M 29 10 2001 2 3 M 1 11 2001 1 4 F 3 11
2008 Nov 17
5
how to calculate another vector based on the data from a combination of two factors
Hi, I have a data set similar to the following State Gender Quantity TX Male 1 NY Female 2 TX Male 3 NY Female 4 I need to calculate cumulative sum of the quantity by State and Gender. The expected output is State Gender Quantity CumQuantity TX Male 1 1 TX Male 3 4 NY Female 2 2 NY Female 4 6 I highly appreciate if someone can give me some hints on solving that in R. Hao -- View this
2013 Apr 18
6
count each answer category in each column
Hey, Is it possible that R can calculate each options under each column and return a summary table? Suppose I have a table like this: Gender Age Rate Female 0-10 Good Male 0-10 Good Female 11-20 Bad Male 11-20 Bad Male >20 N/A I want to have a summary table including the information that how many answers in each category, sth like this: X
2011 Jan 23
2
Creating subsets of a matrix
Hello, Say I have 2 columns, bmi and gender, the first being all the values and the second being male or female. How would I subset this into males only and females only? I have searched these fora and read endlessly about select[] and split() functions but to no avail. Also the table is not ordered. bmi gender -> bmi gender + bmi gender 1 24.78 male
2007 Mar 08
1
how to assign fixed factor in lm
Hi there, > Value=c(709,679,699,657,594,677,592,538,476,508,505,539) > Lard=rep(c("Fresh","Rancid"),each=6) > Gender=rep(c("Male","Male","Male","Female","Female","Female"),2) > Food=data.frame(Value,Lard,Gender) > Food Value Lard Gender 1 709 Fresh Male 2 679 Fresh Male 3 699 Fresh
2023 Nov 04
2
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
I might have factored the gender. I'm not sure it would in any way be quicker. But might be to some extent easier to develop variations of. And is sort of what factors should be doing... # make dummy data gender <- c("Male", "Female", "Male", "Female") WC <- c(70,60,75,65) TG <- c(0.9, 1.1, 1.2, 1.0) myDf <- data.frame( gender, WC, TG ) #
2012 Jan 27
1
Horizontal stacked 100% bars with ggplot2
Hello, R friends, I'm trying to crack this nut: Example Data. pet    gender dog    male dog    female dog    male cat    female cat    female cat    male Plot Task. Horizontal 100% bars where y axis shows gender factor (male vs. female) and x axis shows percentage of kind of pets (dog vs. cat) so that % dogs + % cats are stacked in 1 bar and sum up to 100% (for each gender group 1
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 <-
2008 May 04
2
Ancova_non-normality of errors
Hello Helpers, I have some problems with fitting the model for my data... -->my Literatur says (crawley testbook)= Non-normality of errors-->I get a banana shape Q-Q plot with opening of banana downwards Structure of data: origin wt pes gender 1 wild 5.35 147.0 male 2 wild 5.90 148.0 male 3 wild 6.00 156.0 male 4 wild 7.50 157.0 male 5 wild 5.90
2011 Dec 13
8
How to compute 95%CI for OR from logistic regression?
Hi all: My data has 3 variables: age(3levels : <30y=1 30-50y=2, >50y=3) gender(Male=0, Female=1) CD4 cell count(raw lab measurement) y(1:death 0:alive) I perform logistic regression to find out the factors that influence y. result<-glm(y ~ factor(age) + factor(gender) + CD4,family = binomial) >From the result,I can get OR(Odds Ratio) of gender via exp(Estimate of Female,
2006 Jul 23
3
ANN: scoped_proxy plugin
ScopedProxy uses with_scope and proxy objects to make it easy to find and count different types of records. Example: class Person < ActiveRecord::Base scoped_proxy :minor, :conditions => ''age <= 17'' scoped_proxy :adult, :conditions => ''age >= 18'' scoped_proxy :old, :conditions => ''age >= 70'' scoped_proxy :male,
2012 Jan 26
1
ftable.formula
I apologize in advance if this is the wrong forum for this report/request, and for the fact that I have not read the code for ftable.formula in any detail. >From reading the documentation for ftable.formula, I expected that the following two calls to ftable would produce the same results: data(UCBAdmissions) ftable(UCBAdmissions, row.vars = "Dept", col.vars = c("Gender",
2005 Dec 20
1
Help to find only one class and differennt class
Dear R users, I have a problem, which I can not find a solution. Probably someone could help me? I have a result from my classification, like this > credit.toy [[1]] age married ownhouse income gender class 1 20-30 no no low male good 2 40-50 no yes medium female good [[2]] age married ownhouse income gender class 1 20-30 yes yes high male
2012 Jul 18
3
Mean of matched data
Hi I think/hope there will be a simple solution to this but google-ing has provided no answers (probably not using the right words) I have a long data frame of >2 000 000 rows, and 6 columns. Across this there are 24 000 combinations of gene in a column (n=12000) and gender in a column (n=2... obviously). I want to create 2 new columns in the data frame that on each row gives, in one column
2007 Jan 18
4
Reading contingency tables
I am trying to read an ftable using read.ftable, but I get the following error message: > jobSatTable <- read.ftable("http://definetti.uark.edu/~gpetris/stat5333/jobSatisfaction.dat",skip=2) Error in seek(file, where = 0) : no applicable method for "seek" In addition: Warning messages: 1: no non-missing arguments to max; returning -Inf 2: no non-missing arguments to
2005 Apr 19
1
How to make combination data
Dear R-user, I have a data like this below, age <- c("young","mid","old") married <- c("no","yes") income <- c("low","high","medium") gender <- c("female","male") I want to make some of combination data like these, age.income.dat <- expand.grid(age,
2010 Mar 06
2
Plot interaction in multilevel model
I am trying to plot an interaction in a multilevel model. Here is some sample data. In the following example, it is longitudinal (i.e., repeated measures), so the outcome, score (at each of the three time points), is nested within the individual. I am interested in the interaction between gender and happiness predicting score. id <- c(1,1,1,2,2,2,3,3,3) age <-
2007 Jun 20
2
"xtable" results doesn't correspond to data.frame
Dear useRs, Am trying to use xtable on the following data.frame and I don't get what I expect: example.table <- data.frame(rbind( c("Gender"," "," "," "), cbind(rep(" ",2),c("Male","Female"),c(3.0,4.0),c(3/7,4/7)) )) colnames(example.table) <- c(" "," ","number of