Displaying 20 results from an estimated 10000 matches similar to: "access (exactly/only) one dimension of a multidimensional table"
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
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
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 )
#
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 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
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,
2008 May 02
1
Cant resolve Error Message
Hi,
Im having trouble creating the following graph. Here is my code:
library(plotrix)
library(prettyR)
female_improvement
<-read.table("C://project/graphs/gender/breakdown/gender-improvement/female-improvement.csv",
sep=",", header=TRUE)
barp(rbind(rep(length(female_improvement$gender),2),freq(female_improvement$reason)[[1]]),
ylab="22 Males participated in the
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
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
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
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 <-
2023 Nov 05
1
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
There are many techniques Callum and yours is an interesting twist I had not considered.
Yes, you can specify what integer a factor uses to represent things but not what I meant. Of course your trick does not work for some other forms of data like real numbers in double format. There is a cost to converting a column to a factor that is recouped best if it speeds things up multiple times.
The
2010 Dec 02
1
latex tables for 3+ dimensional tables/arrays
I'm looking for an R method to produce latex versions of tables for
table/array objects of 3 or more dimensions,
which, of necessity is flattened to a 2D display, for example with
ftable(), or vcd::structable, as shown below.
I'd be happy to settle for a flexible solution for the 3D case.
> UCB <- aperm(UCBAdmissions, c(2, 1, 3))
> ftable(UCB)
Dept A B
2023 Nov 03
2
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
Just a minor point in the suggested solution:
df$LAP <- with(df, ifelse(G=='male', (WC-65)*TG, (WC-58)*TG))
since WC and TG are not conditional, would this be a slight improvement?
df$LAP <- with(df, TG*(WC - ifelse(G=='male', 65, 58)))
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Jorgen Harmse via
R-help
Sent: Friday,
2013 Jun 15
2
quick Help needed
Hi,
i am new to this forum and not sure how it works,
I am trying to do deskriptive descripe my data in terms of gender:
head(scltotal)
pbnr dat dep dys sop ago mis age female messpunkt2
messpunkt1 tage eintrittsjahr
1 10023 1994-02-21 0.75 1.00 0.50 0.50 0.75 35 1 8817
8817 0 1994
2 10023 1994-05-25 0.75 1.00 0.50 0.50 0.75 35 1 8910
8817
2009 Sep 11
3
Barplot+Table
I am trying to automate a report that my company does every couple of years
for the state of Maine. In the past we have used SPSS to run the data and then
used complicated Excel template to make the tables/graphics which we then
imported into Word. Since there are 256 tables/graphics for this report, this
work flow is a little painful. I would like to automate the process and I think
I can do
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
2005 Mar 29
1
Mosaicplot with different colors
This dataset below is one sample answer the questioner from our customer.
> testbank <- read.table("testbank.txt", header=T)
> testbank
age married income gender ownhouse class
1 20-30 no high female yes 1st
2 30-40 no high female yes 1st
3 40-50 no low female yes 1st
4 50-60 no high female yes 1st
5 60-70