Re: [R] summing "transfers"

2012-03-16 Thread Farley, Robert
NA NA NA NA NA [ reached getOption("max.print") -- omitted 595 rows ]] But I have no clue if this even has the interchanges I need. Robert Farley LACMTA -Or

[R] summing "transfers"

2012-03-15 Thread Farley, Robert
I have a dataframe from an On-Board Survey with weights ("expwgt") and variables for up to 8 used lines: VEH1 through VEH8. The lines are labeled "MT-..1" through "MT-902". I want to know how many transfers there are between MT-802 and MT-901. That is, when one of them is VEHx and the other is

Re: [R] subset problem

2012-03-15 Thread Farley, Robert
ystem file > Robert Farley LACMTA -Original Message- From: jim holtman [mailto:jholt...@gmail.com] Sent: Wednesday, 14 March, 2012 20:36 To: Farley, Robert Cc: R-help@r-project.org Subject: Re: [R] subset problem Supply an 'str' of your dataframe so we can see what its

[R] subset problem

2012-03-14 Thread Farley, Robert
I'm having a simple problem with subset. I'm choosing what I think is a valid selection, but I either get everything or an empty dataframe. What am I doing wrong? > > describe(OBDataSumm) Description of OBDataSumm Numeric meanmedian varsd valid.n SAMP

[R] Aggregating Survey responses for weighting

2011-10-17 Thread Farley, Robert
I have about 27,000 survey responses from across about 150 Bus Routes, each with potentially 100 stops. I've recorded the total Ons and Offs for each stop on each bus run, as well as the stop pair each survey response corresponds to. I wish to create weights based on the On and Off stop for eac

[R] OT RE: US States percentage change plot

2011-10-13 Thread Farley, Robert
OT question: can R produce Cartograms? Here's an example of World Population: http://www.worldmapper.org/display.php?selected=2 This might make Texas smaller and Rhode Island larger Robert Farley LACMTA -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@

[R] Advice on approach to weighting survey

2011-09-30 Thread Farley, Robert
I'm about to add weights to a bus on-board survey dataset with ~150 variables and ~28,000 records. My intention is to weight (for each bus "run") by boarding stop and alighting stop. I've seen the Rake function of the Survey package, but it seems that converting to a "svydesign" might be exces

Re: [R] Constrain density to 0 at 0?

2010-07-20 Thread Farley, Robert
individual measurements. Is there a "variable bw" that could be set small at the extrema, and larger in the range of the data? Robert Farley Metro www.Metro.net -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Monday, July 19, 2010 19:31 To: Fa

[R] Constrain density to 0 at 0?

2010-07-19 Thread Farley, Robert
I'm plotting some trip length frequencies using the following code: plot( density(zTestData$Distance, weights=zTestData$Actual), xlim=c(0,10), main="Test TLFD", xlab="Distance", col=6 ) lines(density(zTestData$Distance, weights=zTestData$FlatWeight), col=2) lines(density(zTestData$

[R] Weighted densityplot?

2010-07-15 Thread Farley, Robert
I'm trying to plot a series of densities using/comparing differing weights. I see the reference to weights and subscripts, but I don't understand how to implement that. My data are of the form: I, J, Actual, Distance, Subset, Weight1, Weight2, ... I'm trying to see the effect of the distance

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
project.org] On Behalf Of Michael Bibo Sent: Monday, August 10, 2009 17:13 To: r-h...@stat.math.ethz.ch Subject: Re: [R] NotePad++ Syntax file Farley, Robert metro.net> writes: > > > Does anyone have an R Syntax Highlighting file {userDefineLang.xml} for NotePad++?? I've started one

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
port for Hex, column, or other languages. Robert Farley Metro www.Metro.net -Original Message- From: John Kane [mailto:jrkrid...@yahoo.ca] Sent: Monday, August 10, 2009 15:59 To: 'r-help@r-project.org'; Farley, Robert Subject: Re: [R] NotePad++ Syntax file No but

[R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
Does anyone have an R Syntax Highlighting file {userDefineLang.xml} for NotePad++?? I've started one, but I'm not so happy with it. Robert Farley Metro 1 Gateway Plaza Mail Stop 99-23-7 Los Angeles, CA 90012-2952 Voice: (213)922-2532 Fax:(213)922-2868 www.Metro.net [[alternat

Re: [R] Simple Question: adding points to a boxplot

2009-08-10 Thread Farley, Robert
", na.strings="NA", dec=".", strip.white=TRUE) boxplot(ObsRpdData) points(1:length(EstRpdData),EstRpdData, pch=16, col="red") # pch=16 = solid circle # -------- -Origi

Re: [R] Simple Question: adding points to a boxplot

2009-08-07 Thread Farley, Robert
data checking process before data analysis? == boxplot(ObsRpdData) points(1:length(EstRpdData),EstRpdData, pch=16, col="red) === Robert Farley Metro www.Metro.net -Original Message----- From: Farley, R

[R] Simple Question: adding points to a boxplot

2009-08-07 Thread Farley, Robert
I apologize in advance for the simplicity of this question. I use R 2-3 times a year, and I seem to forget more in the intervening months than I learn during my days of panicked reading I HAVE tried looking at the help resources; I'm just not very good at understanding them. I have a data

Re: [R] Still can't find missing data - How do I get NA in xtabs with factors?

2009-06-02 Thread Farley, Robert
om] Sent: Sunday, May 31, 2009 14:27 To: Farley, Robert Subject: Re: Still can't find missing data - How do I get NA in xtabs with factors? you might want to try 'table' - with the exclude option -rather than 'xtabs': with(data,table(a, b, exclude="NULL")) I *t

Re: [R] Still can't find missing data - How do I get NA in xtabs with factors?

2009-05-29 Thread Farley, Robert
vel" and R does not? Will this be a problem with read.dta as well? Robert Farley Metro www.Metro.net -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: Thursday, May 28, 2009 20:39 To: Farley, Robert Subject: RE: [R] Still can't find missing data In R

Re: [R] Still can't find missing data

2009-05-28 Thread Farley, Robert
arley Metro www.Metro.net -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: Thursday, May 28, 2009 16:26 To: Farley, Robert Subject: RE: [R] Still can't find missing data Try reading it in with read.table's argument stringsAsFactors=FALSE. I think the underlyi

Re: [R] Still can't find missing data

2009-05-28 Thread Farley, Robert
bert Farley Metro www.Metro.net -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dieter Menne Sent: Thursday, May 28, 2009 05:46 To: r-help@r-project.org Subject: Re: [R] Still can't find missing data Farley, Robert wrote: > >

Re: [R] Still can't find missing data

2009-05-27 Thread Farley, Robert
foreign_0.8-29 > Robert Farley Metro www.Metro.net -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dieter Menne Sent: Wednesday, May 27, 2009 02:52 To: r-h...@stat.math.ethz.ch Subject: Re: [R] Still can't find missing da

[R] Still can't find missing data

2009-05-26 Thread Farley, Robert
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

[R] How do I get xtabs to show missing data?

2009-02-18 Thread Farley, Robert
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

[R] Problems with svyhist

2009-02-06 Thread Farley, Robert
I have two problems with svyhist. I hope this is easy, and it may be that "simple R syntax" will do what I need. 1) I'm able to get a single plot out, but I need to put two distributions in the same graphic to visually compare them. 2) I get uniform breaks at intervals of 10. I can p

[R] Comparing weighted histograms?

2009-02-05 Thread Farley, Robert
I'm trying to plot and compare weighted histograms and I can't seem find where to start. I have data similar to this: Miles2LAX RADAM2005Pct LAWA2005Pct 35.57.00123.00684 24.74.00118.00187 27.09.00965

Re: [R] maptools sunrise sunset function

2008-11-10 Thread Farley, Robert
I have a time zone problem. Running the code provided I get the result in UTC, and a lot of warnings like this: 28: In as.POSIXlt.POSIXct(x, tz) ... : unknwon timezone 'PST' > sunrise.set(34.11583, -118.18719, "2008-11-14") sunrise sunset newlon 2008-11-14 14:

[R] How do I read a text (.csv) file to match a matrix/cross tab? (Object confusion??)

2008-11-05 Thread Farley, Robert
I'm having a problem reading data to set control totals for a dataframe. I want to adjust a dataframe based on a 2-d table of values, which I get by using : > CurrentX1Sums <- as.matrix(xtabs(~tripid_nu+lineon, data=SurveyData)) > CurrentX2Sums <- apply(CurrentX1Sums, 1, sum) I've created a

[R] Why are these different?

2008-10-31 Thread Farley, Robert
I want to import some "target values" to normalize elements of a dataframe. I'm summarizing the existing totals using as.matrix(xtabs(~tripid_nu+lineon, data=SurveyData)) and reading a .csv table of target values. I can't even get them to list out as similar data items. My idea is to do

Re: [R] Digest setting won't "take"

2008-10-31 Thread Farley, Robert
ailto:[EMAIL PROTECTED] On Behalf Of Marianne Promberger Sent: Friday, October 31, 2008 12:17 To: r-help@r-project.org Subject: Re: [R] Digest setting won't "take" On Friday, 31 October 2008, 10:46 (UTC-0700), Farley, Robert wrote: > I've been trying to set my email setting to

[R] Digest setting won't "take"

2008-10-31 Thread Farley, Robert
I've been trying to set my email setting to Digest Mode for a while, but it doesn't seem to "take". I log through to the "Unsubscribe or edit options" button on the Web interface to the R-help mailing list page. I scroll down to the "Set Digest Mode" box and change the radio button to "On"

Re: [R] Trying to "expand" some data - Newbie needs help

2008-10-29 Thread Farley, Robert
t;- apply(CurrentX1Sums, 1, sum) NewTargetX1Sums <- as.matrix(NewTargetData) NewTargetX2Sums <- apply(NewTargetX1Sums, 1, sum) Robert Farley Metro www.Metro.net -Original Message- From: Erik Iverson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 19:58 To: Farl

[R] Trying to "expand" some data - Newbie needs help

2008-10-29 Thread Farley, Robert
I want to calculate "expansion factors" for elements in my dataframe based on a 2-d cross classification. Since I'll have "missing values" (many combinations will have no record) I'll need a second "expansion factor" for each "row". I've included my "work to date" below, but I'm not very close t

[R] newbie Syntax questions: Re-Calculating expansion factors

2008-10-22 Thread Farley, Robert
I have a dataframe with many hundreds of survey records containing: tripid_nu, lineon, MuchOtherData, X1, X2, X3, X4 tripid_nu = identifier for each "Trip" {E.g. for EB MTA-901 leaving the first stop at 07:24} lineon = identifier for each of the stop locations Where X1 is

Re: [R] How to draw the graph of f(x,y) = x * y ?

2008-09-24 Thread Farley, Robert
You could always try F(x,y) = f(x) + 0*y That is "zero out" the degenerate dimensions. Of course you'll be plotting what is essentially a two dimensional object as if it were three dimensional. The degeneracy in y means a 2-D curve will be "extruded" along the Y dimension. Robert Farley Met

Re: [R] Survey Design / Rake questions

2008-08-28 Thread Farley, Robert
3 levels "Warner Center",..: 3 1 1 1 2 13 1 5 1 5 ... > str(ByEBOn$StnName) Factor w/ 13 levels "Balboa","De Soto",..: 11 2 5 8 6 1 12 7 10 13 ... > all(levels(EBSurvey$lineon)==StnName) [1] TRUE > # > str(EBDesign$NumStn) NULL > str(EBSurvey$NumStn) Factor w/ 12 levels "1","2","3","4",..: 10 12 4 12 8 1 8 8 12 4 ... > str(ByEBNum$StnTraveld)

Re: [R] Two envelopes problem

2008-08-26 Thread Farley, Robert
So if I put $10 and $20 into the envelopes, then told you that the values were multiples of $10, it would be wrong for you to assess probabilities on $100, $1,000,000 and so on? :-) But what if you reasoned that there were far more multiples of 10 above 20 than below 20? What if I was really ev

Re: [R] Survey Design / Rake questions

2008-08-25 Thread Farley, Robert
Survey$NumStn) Factor w/ 12 levels "1","2","3","4",..: 10 12 4 12 8 1 8 8 12 4 ... > EBSurvey$NumStn[1:5] [1] 10 12 4 12 8 Levels: 1 2 3 4 5 6 7 8 9 10 11 12 > str(ByEBNum$StnTraveld) int [1:12] 1 2 3 4 5 6 7 8 9 10 ... > ByEBNum$StnTraveld[1:5]

Re: [R] Survey Design / Rake questions

2008-08-25 Thread Farley, Robert
",..: 10 12 4 12 8 1 8 8 12 4 ... > EBSurvey$NumStn[1:5] [1] 10 12 4 12 8 Levels: 1 2 3 4 5 6 7 8 9 10 11 12 > str(ByEBNum$StnTraveld) int [1:12] 1 2 3 4 5 6 7 8 9 10 ... > ByEBNum$StnTraveld[1:5] [1] 1 2 3 4 5 > *

Re: [R] Survey Design / Rake questions

2008-08-22 Thread Farley, Robert
Canyon North Hollywood Pierce College Reseda Sepulveda Tampa Valley College Van Nuys Warner Center Woodley Woodman > > str(EBSurvey$NumStn) Factor w/ 12 levels "1","2","3","4",..: 10 12 4 12 8 1 8 8 12 4 ... > EBSurvey$NumStn[1:5] [1] 10 12 4 12 8 Levels: 1 2 3 4 5 6 7 8 9 10 11 12 > str(ByEBNum$StnTraveld) Factor w/ 12 levels "1","10","11",.

[R] data.frame() creates list?

2008-08-20 Thread Farley, Robert
I obviously don't know what I'm doing. I want to create "ByEBNum" as a data frame, but it comes out as a list. How do I make it a data frame? > EBNumStn <- c(673.65, 800, 1000, 1000, 800, 700, 600, 500, 400, 200, 50, 50 ) > ByEBNum <- data.frame(c(1:12),EBNumStn) > typeof(EBNumSt

Re: [R] Survey Design / Rake questions

2008-08-20 Thread Farley, Robert
NumStn ) ) Error in model.frame.default(margin, data = design$variables) : invalid type (list) for variable 'ByEBOn' > Robert Farley Metro www.Metro.net -Original Message- From: Stas Kolenikov [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2008 07:13 To: Farley,

Re: [R] Survey Design / Rake questions

2008-08-19 Thread Farley, Robert
h_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] graphics grDevices utils datasets stats methods base other attached packages: [1] survey_3.8 fortunes_1.3-5 moonsun_0.1prettyR_1.3-2 foreign_0.8-28 > #

Re: [R] Survey Design / Rake questions

2008-08-18 Thread Farley, Robert
tal flaws" in this concept Robert Farley Metro www.Metro.net -Original Message----- From: Stas Kolenikov [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2008 10:32 To: Farley, Robert Cc: r-help@r-project.org Subject: Re: [R] Survey Design / Rake questions Yo

[R] Survey Design / Rake questions

2008-08-18 Thread Farley, Robert
I'm trying to learn how to calibrate/postStratify/rake survey data in preparation for a large survey effort we're about to embark upon. As a working example, I have results from a small survey of ~650 respondents, ~90 response fields each. I'm trying to learn how to (properly?) apply the aforemen

Re: [R] Simple (?) subset problem

2008-08-14 Thread Farley, Robert
ctor with ~15 "levels" and I'm a REALLY poor typist} Thanks! Robert Farley Metro www.Metro.net -Original Message- From: Erik Iverson [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2008 15:47 To: Farley, Robert Cc: r-help@r-project.org Subject: Re: [R] Simple (?) s

[R] Simple (?) subset problem

2008-08-14 Thread Farley, Robert
I can't figure out the syntax I need to get subset to work. I'm trying to split my dataframe into two parts. I'm sure this is a simple issue, but I'm stumped. I either get all or none of the original "rows". > XTTable <- xtabs( ~ direction_ , SurveyData) > XTTable direction_

Re: [R] Survey questions

2008-07-07 Thread Farley, Robert
the details of designing a "post survey survey" to generate additional weights? Thanks in advance, Robert Farley Metro www.Metro.net ____________ From: Farley, Robert Sent: Thursday, June 26, 2008 15:48 To: 'r-help@r-project.org' Subje

[R] Survey questions

2008-06-26 Thread Farley, Robert
First the R question. I have the results of a rather large survey (thousands of forms, each with dozens of questions) with some existing weights and expansion factors. I wish to add additional weighting factors, based on new information that elements of certain variables should appear in certain

Re: [R] read.spss {foreign} doesn't work over network?

2008-06-18 Thread Farley, Robert
ROTECTED] Sent: Tuesday, June 17, 2008 23:40 To: Farley, Robert Cc: r-help@r-project.org Subject: Re: [R] read.spss {foreign} doesn't work over network? This looks like a restriction on your network (assuming the file is named correctly). I can read SPSS files with read.spss over ours, and th

[R] read.spss {foreign} doesn't work over network?

2008-06-17 Thread Farley, Robert
I'm unable to open an SPSS file over my network. If I copy it to my local C:/ drive I can read it. I saved the command (in a "crib sheet" text file) in order to avoid all the typing, so I'm pretty sure I've done it before. I verified that the file I'm trying to read is OK. This is what happens:

Re: [R] Monty Hall simulation

2008-05-12 Thread Farley, Robert
The common "Monty Hall" problem (where the MC helps out the contestant) is not random! See: http://en.wikipedia.org/wiki/Monty_Hall_problem My edits were removed as I had no references. :-( Maybe you can verify my statements, included below. :-) Another analysis considers three types of h

Re: [R] Gravity (spatial interaction) models in R

2008-05-07 Thread Farley, Robert
There may already be tools for gravity model APPLICATION, which is simply an exercise in normalization. Perhaps if I describe the gory details, someone will recognize the problem by another name. A singly constrained gravity model is simply an exercise in normalizing the rows of a matrix (you

[R] newbie subset question

2008-04-03 Thread Farley, Robert
I want to look at all the records making up a "row and column" of a crosstab, but I'm not getting it right. I'm trying to use subset() but my selection ((prod_act=="other") || (attr_act=="other")) gives my no records. See the second table below. Getting just the row does work, as seen in the thi