similar to: Expand a contingency table based on the value in one column

Displaying 20 results from an estimated 30000 matches similar to: "Expand a contingency table based on the value in one column"

2009 Jan 26
1
reshape problem: id and variable names not being recognized
Hi everyone. Long time listener, first-time caller here. I have a data set that's been melted with the excellent reshape package, but I can't seem to cast it the way I need to. Here's the melted data's structure: > str(mdat) 'data.frame': 6978 obs. of 4 variables: $ VehType : Factor w/ 2 levels "Car","Truck": 1 1 2 1 1 2 1 1 1 1 ... $ Year :
2009 May 26
3
Still can't find missing data
I'm trying to prepare some cross tabs, looking at a number of variables against a variable "connector" which has 2 values: "OD Passenger" and " Connector". When I produce a xtabs one way I have observations under "Connector" but against a different variable "Connector" shows all 0 values. What is wrong? I've looked into the na commands
2009 Feb 19
1
How do I get xtabs to show missing data?
I presume the behavior below (no Connector values in the second table) is because I have na values in my dataframe. How do I get them to list? I found references to na.action and na.pass, but I could not figure out how I could use them with xtabs to list the na as a value. I'm sure there's a simple syntax I need, but it's not obvious to me. > # Weighted Data
2011 Jun 06
2
qplot fill and colour not working as expected
I am just learning to use qplot and can't get the fill/colour to work. Below is the R code for a scatter plot and bar graph. library(ggplot2) x<-c(1,2,3,4,5,6,7) y<-c(1,2,3,2,5,6,3) qplot(x,y, main="Scatter Plot Test", xlab="X Label Test", ylab="Y Label Test", colour="blue")z<-c("van", "van", "van",
2011 Aug 11
1
help with loops
hi I need help with list object. I have a list object > a <- c('apple','orange','grape') > b <- c('car','truck','jeep') > c <- list(a,b) > names(c) <- c('fruit','vehicle') > c $fruit [1] "apple" "orange" "grape" $vehicle [1] "car" "truck"
2009 Jun 22
4
SAS-like method of recoding variables?
Dear R-helpers, I am helping a SAS user run some analyses in R that she cannot do in SAS and she is complaining about R's peculiar (to her!) way of recoding variables. In particular, she is wondering if there is an R package that allows this kind of SAS recoding: IF TYPE='TRUCK' and count=12 THEN VEHICLES=TRUCK+((CAR+BIKE)/2.2); Thanks for any help or suggestions you might be able
2009 Jan 10
1
Setting a contingency table
Hi, I want to set a make a contingency table which will look like this.. The problem is that I can't  set the table like the following.                      col1     col2       Total     row1              a         b         n10                      rp1       rp2        100                      cp1       cp2       rtp1   ---------------------------------------------     row2            
2010 Jun 08
2
constructing a contingency table (ftable, table)
Dear all, an hopefully quick table question. I have the following data: Two objects that are 2*9 matrix with nine column names (Dis1, ..., Dis9) and the row names (2010,2020). The content are frequencies (numeric). In want to create a table that is along the lines of ftable(UCBAdmissions) and should looks like this: Dis1 | ...| Dis9 2010|2020|....|2010|2020 (first row,first column is the value
2014 May 11
0
YAMAHA CAR ADVERT!!!
Hello, We are currently seeking to employ individual?s world wide. How would you like to make money by simply driving your car advertising for YAMAHA. How it works? Here?s the basic premise of the "paid to drive" concept: YAMAHA seeks people -- regular citizens,professional drivers to go about their normal routine as they usually do, only with a big advert for new "YAMAHA YZF-R6
2009 Sep 25
1
if else and loop for code in R
I am using if else and loop to sortout the data set that is the values less than o or more than 100 will be chosen.I could not get outTable with loop. Please help me to correct the code: I USED: # Read a_data <- read.table("D:/SNP/copy.sas", header=T, sep="\t") tr <- a_data$truck ca <- a_data$cars length <- nrow(a_data) outTable <- matrix(nrow=length,ncol=3)
2006 Jun 01
1
find not working properly
here is the input view [code] <form method="post" action="found"> <br> <b>Find by</b><br/> <b>Vehicle Number:</b><br/> <input id="truck_vehicleID" name="truck[vehicleID]" size="20" type="number" value=""/><br/> </p> <%= link_to "Find", :action
2009 Jan 20
1
generalizing expand.table: table -> data.frame
In http://tolstoy.newcastle.edu.au/R/e2/help/06/10/3064.html a method was given for converting a frequency table to an expanded data frame representing each observation as a set of factors. A slightly modified version was later included in the NCStats package, only on http://rforge.net/ (and it has too many dependencies to be useful). I've tried to make it more general, allowing an input
2010 Dec 09
1
displaying a note or comment when --format doc
I''m new to rspec, so, I might be coloring outside the lines, but, there have been several instances where I have wanted to display a comment or note. for example: describe "truck" do it "should require model" do end end rspec spec --format doc truck should require model What I mean by display a comment or note would be like: truck NOTE: blah, blah,
2006 May 15
0
wrong argument type String (expected Module)
Hello, When I create a select in a form, I get this error: wrong argument type String (expected Module) I know that ''type'' is a reserved word for STI and that''s what I want: a select box to choose the right type of Vehicule object: TYPES = [ ["Car", "Car"], ["Truck", Truck"], ["Bike", "Bike"] ] and <%= options
2005 Sep 29
2
Hardware Specifications
Does anyone know where i can find out how powerful a machine has to be to handle a certain amount of call volume? Eg, 2Ghz is enough processing power to maintain 100 calls at a time. 4Ghz is engouh to process 250 calls etc etc. Thanks Dan -------------- next part -------------- An HTML attachment was scrubbed... URL:
2003 May 07
0
This Car Shipping Company Might Interst You. (PR#2938)
2019 Oct 04
1
CentOS 8 network-scripts
On Fri, 4 Oct 2019 at 10:41, Valeri Galtsev <galtsev at kicp.uchicago.edu> wrote: > > > > On 2019-10-04 08:03, Chris Adams wrote: > > Once upon a time, Ljubomir Ljubojevic <centos at plnet.rs> said: > >> Bridge for VM's is main reason I hate NM. > > +1 > > My impression is younger generation doesn't value rules that programmers > were
2011 Dec 17
1
Binning a 2 column matrix by avarages of rows.
Newbie here. Many apologies in advance for using the incorrect lingo. I'm new to statistics and VERY new to R. I have a "nx2" matrix , I want to sort the values based on the average of 2 columns and put k lowest (or highest) values in bin1, second k high/low values in bin2, and so on (bins would be of the same dimensions). I should also know what the first index (or position) of
2007 Apr 19
1
Error with strptime
Dear All, I am trying to convert to POSIXct after pasting a date and a time in character format with strptime. It is probably obvious but I don't understand why I get an error message after bsamp$spltime<-strptime(test,format="%d-%B-%y %H:%M") whereas I can get what I want if I do it in 2 steps and rbinding ? Thanks and best regards, Jean-Louis This is the R console output
2003 Jul 14
2
qualitative response model
Hi, I want to know is there other functions in R to estimate qualitative response model besides multinom() in library nnet, if this is the only possibility, I have a question about the application: for example: there is three transportation choice : car, bus , subway. each alternative has own characteristic variables, I want to apply conditional logit model to analysis the choice of three