Re: [R] summing transfers

2012-03-16 Thread Farley, Robert
(max.print) -- omitted 595 rows ]] But I have no clue if this even has the interchanges I need. Robert Farley LACMTA -Original Message- From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] Sent: Thursday, 15 March, 2012 19:34 To: Farley, Robert; R-help@r-project.org Subject: Re: [R] summing

Re: [R] subset problem

2012-03-15 Thread Farley, Robert
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 structure is. Do you have leading/trailing blanks in your ROUTE

[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

[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 SAMPN

[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

[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

[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

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

2010-07-20 Thread Farley, Robert
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: Farley, Robert Cc: r-help@r-project.org Subject: Re: [R

[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)

[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] Simple Question: adding points to a boxplot

2009-08-10 Thread Farley, Robert
) # pch=16 = solid circle # -Original Message- From: Phil Spector [mailto:spec...@stat.berkeley.edu] Sent: Friday, August 07, 2009 19:00 To: Farley, Robert Subject: Re: [R] Simple Question: adding

[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

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
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 have you had a look at Tinn-R http

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
] 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 FarleyR at metro.net writes: Does anyone have an R Syntax Highlighting file {userDefineLang.xml} for NotePad++?? I've started one, but I'm not so happy

[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

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

2009-08-07 Thread Farley, Robert
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, Robert Sent

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

2009-06-02 Thread Farley, Robert
, 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 *think* that the problem is that xtabs excludes NAs

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

2009-05-29 Thread Farley, Robert
? 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 factors don't save space over character vectors - only one copy of any given

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

2009-05-28 Thread Farley, Robert
-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: I can't get the syntax that will allow me to show NA values (rows) in the xtabs. lengthy non-reproducible

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

2009-05-28 Thread Farley, Robert
-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 underlying problem is that exclude= is used

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

2009-05-27 Thread Farley, Robert
Sent: Wednesday, May 27, 2009 02:52 To: r-h...@stat.math.ethz.ch Subject: Re: [R] Still can't find missing data Farley, Robert FarleyR at metro.net writes: What is wrong? I've looked into the na commands and the ?xtabs entry, but I haven't found anything that works. I never understood

[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 is

[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

[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

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

[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] 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. I

Re: [R] Digest setting won't take

2008-10-31 Thread Farley, Robert
:[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 Digest Mode for a while

[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

[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 to getting

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

2008-10-29 Thread Farley, Robert
(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: Farley, Robert Subject: Re: [R] Trying to expand some data - Newbie needs help Farley, Robert wrote: I want

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 Metro

Re: [R] Survey Design / Rake questions

2008-08-28 Thread Farley, Robert
: Thursday, August 28, 2008 11:43 To: Farley, Robert Cc: r-help@r-project.org Subject: Re: [R] Survey Design / Rake questions On Mon, 25 Aug 2008, Farley, Robert wrote: I see a number of things that bother me. 1) str(ByEBNum$StnTraveld) says int [1:12] 1 2 3 4 5 6 7 8 9 10 ... Even

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

Re: [R] Survey Design / Rake questions

2008-08-25 Thread Farley, Robert
Robert Farley Metro www.Metro.net -Original Message- From: Thomas Lumley [mailto:[EMAIL PROTECTED] Sent: Saturday, August 23, 2008 09:38 To: Farley, Robert Cc: r-help@r-project.org Subject: Re: [R] Survey Design

Re: [R] Survey Design / Rake questions

2008-08-25 Thread Farley, Robert
To: Farley, Robert Cc: r-help@r-project.org Subject: Re: [R] Survey Design / Rake questions On Fri, 22 Aug 2008, Farley, Robert wrote: I *think* I'm making progress, but I'm still failing at the same step. My rake call fails with: Error in postStratify.survey.design(design, strata[[i

Re: [R] Survey Design / Rake questions

2008-08-22 Thread Farley, Robert
PROTECTED] Sent: Thursday, August 21, 2008 13:55 To: Farley, Robert Cc: r-help@r-project.org Subject: Re: [R] Survey Design / Rake questions On Tue, 19 Aug 2008, Farley, Robert wrote: While I'm trying to catch up on the statistical basis of my task, could someone point me to how I should fix my R

Re: [R] Survey Design / Rake questions

2008-08-20 Thread Farley, Robert
: Wednesday, August 20, 2008 07:13 To: Farley, Robert Cc: r-help@r-project.org Subject: Re: [R] Survey Design / Rake questions On Mon, Aug 18, 2008 at 6:18 PM, Farley, Robert [EMAIL PROTECTED] wrote: My motivation is to try to correct for a time on board bias we see in our surveys. Not surprisingly

[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(EBNumStn)

Re: [R] Survey Design / Rake questions

2008-08-19 Thread Farley, Robert
Message- From: Farley, Robert Sent: Monday, August 18, 2008 16:18 To: 'r-help@r-project.org' Subject: RE: [R] Survey Design / Rake questions Thank you for the list of references. Do you know of any free references available online? I'll have to find my library card :-) My motivation

[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

Re: [R] Survey Design / Rake questions

2008-08-18 Thread Farley, Robert
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 Your reading, in increasing order of difficulty/mathematical details, might be Lohr's Sampling (http://www.citeulike.org/user/ctacmo

[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] Simple (?) subset problem

2008-08-14 Thread Farley, Robert
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 (?) subset problem I can't tell exactly what's wrong, just check out the ?str and ?levels

Re: [R] Survey questions

2008-07-07 Thread Farley, Robert
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' Subject: Survey questions First the R

[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
: 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 the code in read.spss

[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

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

[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 third