search for: ny

Displaying 20 results from an estimated 2072 matches for "ny".

Did you mean: any
2018 May 18
3
exclude
Hi All, I have a sample of data set show as below. tdat <- read.table(textConnection("stat year Y AL 2003 25 AL 2003 13 AL 2004 21 AL 2006 20 AL 2007 12 AL 2009 16 AL 2010 15 FL 2006 63 FL 2007 14 FL 2007 25 FL 2009 64 FL 2009 47 FL 2010 48 NY 2003 50 NY 2004 51 NY 2006 57 NY 2007 62 NY 2007 36 NY 2009 87 NY 2009 96 NY 2010 91 NY 2010 59 NY 2010 80"),header = TRUE,stringsAsFactors=FALSE) There are three states, I wan tto select states taht do ahve records in all year. Example, xtabs(Y~stat+year, tdat)...
2009 Dec 03
4
Two-way/Three-way sum.
Hi R Users, I'm wondering how can I calculate two (or three) way sum of a variable. A sample data is: State Month Year Value NC Jan 1996 1 NC Jan 1996 2 NC Feb 1997 2 NC Feb 1997 3 NC Mar 1998 3 NC Mar 1998 4 NY Jan 1996 4 NY Jan 1996 5 NY Feb 1997 5 NY Feb 1997 6 NY Mar 1998 6 NY Mar 1998 7 I'm trying to sum up "value" column by State*Month and by State*Month*Year. Also, I may need to calculate mean value along with "sum". Any help would be greatly appreciated, Thanks, Peng [[...
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 -...
2018 May 18
0
exclude
...nd similar to Jim's suggestion but perhaps slightly simpler (or not!): > cross <- xtabs( Y ~ stat + year, data = tdat) > keep <- apply(cross, 1, all) > keep <- names(keep)[keep] > cross[keep,] year stat 2003 2004 2006 2007 2009 2010 AL 38 21 20 12 16 15 NY 50 51 57 98 183 230 > ## for counts just do: > xtabs( ~ stat + year, data = tdat[tdat$stat %in% keep, ]) year stat 2003 2004 2006 2007 2009 2010 AL 2 1 1 1 1 1 NY 1 1 1 2 2 3 Cheers, Bert Bert Gunter "The trouble with having an...
2011 Jan 16
4
a remove question
Dear R People: I have the following: > ls(pattern="NY*") [1] "CRAN_df" "CRAN_df0" "CRAN_df1" "CRAN_mat" "CRAN_sp" [6] "CRAN_spdf1" "CRAN_spdf2" "CRAN_spdf4" "delauney_NY" "dist2_NY" [11] "dist3_NY" "Gabr...
2018 May 18
1
exclude
...as Error in allstates : object 'allstates' not found Bert, it is working. However, If I want to chose to include only mos years example, 2003,2004,2007 and continue the analysis as before. Where should I define the years to get as follow. 2003 2004 2007 AL 2 1 1 NY 1 1 2 Thank you again. On Thu, May 17, 2018 at 8:48 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > ... and similar to Jim's suggestion but perhaps slightly simpler (or not!): > > > cross <- xtabs( Y ~ stat + year, data = tdat) > > keep <-...
2008 Jan 15
1
help with reshaping data into long format (correct question)
Dear list, I have the following data set id 1 2 3 4 5 6 7 8 9 10 disease a b c d e f g h i j age 23 40 32 34 25 32 22 35 29 21 city NY LD NY SG NY LD VG SA LD SG sex 1 1 2 2 2 2 1 1 1 2 treat_a y y y y treat_b n n n n n n ques1_1 2 4 5 6 8 3 1 2 4 5 ques1_2 6 4 5 12 10 9 8 4 5 7 ques1_3 17 23 32 25 14 24 23 22 32 29 ques2_1 4 7 9 10 6 8 5 7 8...
2011 Dec 15
2
lm and R-squared (newbie)
Hello, I've two data.frames (data1 and data4), dec="." and sep=";". http://r.789695.n4.nabble.com/file/n4199964/data1.txt data1.txt http://r.789695.n4.nabble.com/file/n4199964/data4.txt data4.txt When I do plot(data1$nx,data1$ny, col="red") points(data4$nx,data4$ny, col="blue") , results seem very similar (at least to me) but the R-squared of summary(lm(data1$ny ~ data1$nx)) and summary(lm(data4$ny ~ data4$nx)) are very different (0.48 against 0.89). Could someone explain me the reason? To be complet...
2024 Aug 09
1
WDI package commands timing out and not working
...;> on Fri, 9 Aug 2024 15:23:58 +0300 writes: > ? Thu, 8 Aug 2024 12:43:23 +0530 > Anupam Tyagi <anuptyagi at gmail.com> ?????: >> In open.connection(con, "rb") : >> URL >> 'https://api.worldbank.org/v2/en/country/OED/indicator/NY.ADJ.NNAT.GN.ZS?format=json&date=1977:2020&per_page=32500&page=1': >> Timeout of 60 seconds was reached > If you try to open the link in the browser, does it work? How long does > it take to download? Try increasing options(timeout=...) to a larger > t...
2010 Oct 01
1
colored rasterImage()
Hello, I have been exploring the possibility to transition some code that currently uses image() to use the new rasterImage(). To date, I haven't been able to specify a color look-up strategy that works. For example... nx <- 100 ny <- 100 m <- matrix(data = rep(seq(0,1, length = nx), ny), ncol = nx, nrow = ny, byrow = TRUE) plot(1:nx, 1:ny, type = "n") my.color <- matrix(data = (rainbow(100))[m*100], ncol = nx, nrow = ny, byrow = TRUE) rasterImage(m, 1, 1, nx, ny, col = my.color) This yields a greyscal...
2006 May 14
1
Dragable element
...39;''); iY = oiY.replace(''px'', ''''); //$(''ggggg'').innerHTML = ''X: ''+iX+'' Y: ''+iY; } function moveProductImage(x, y, prod){ var nX = x.replace(''px'', ''''); var nY = y.replace(''px'', ''''); //var nxpos=0, nypos=0; if(nY < iY){ nypos = nY - iY; // 25 - } else if(nY > iY){ nypos = iY - nY; } if(nX < iX){ nxpos = nX - iX; } else if(nX > iX){ nxpos = iX - nX; } new Effect.MoveBy(pr...
2008 Jan 15
0
Help with reshape data into long format
Dear list, I have the following data set id 1 2 3 4 5 6 7 8 9 10 disease a b c d e f g h i j age 23 40 32 34 25 32 22 35 29 21 city NY LD NY SG NY LD VG SA LD SG sex 1 1 2 2 2 2 1 1 1 2 treat_a y y y y treat_b n n n n n n ques1_1 2 4 5 6 8 3 1 2 4 5 ques1_2 6 4 5 12 10 9 8 4 5 7 ques1_3 17 23 32 25 14 24 23 22 32 29 ques2_1 4 7 9 10 6 8 5 7 8...
2024 Aug 09
1
WDI package commands timing out and not working
...below for some messages from the system. I am using the latest version of WDI. I installed it recently. I checked in the browser using the URL provided in the warning messages: The World Bank web API gave me the indicator in less than a second. > system.time(dat3IN <- WDI(indicator = c('NY.ADJ.NNAT.GN.ZS','NY.GNS.ICTR.GN.ZS','NY.ADJ.DCO2.GN.ZS','NY.ADJ.DNGY.GN.ZS', 'NY.ADJ.DFOR.GN.ZS', 'NY.ADJ.DPEM.GN.ZS', 'NY.ADJ.DMIN.GN.ZS', 'NY.ADJ.DRES.GN.ZS'), country = c('IN'), start=1960)) user system elapsed 0.14 0.0...
2006 Oct 20
2
Clicking Noise on Pure Voip Calls
Setup: Asterisk server in NY. Cisco 7960 IP Phones in NY and London. Dedicated T1 from NY to Ldn. T1: Latency - 100ms Qos applied No errors Default codec on Ldn IP Phones = g711alaw Default codec on NY IP Phones = g711ulaw Both codecs allowed on each phone. Issue: Calls on IP Phones from NY to London hear clicking noise on...
2008 Mar 16
1
stats/debugging question hotelling t-sq
...;http://www.niehs.nih.gov/research/atniehs/core/microarrays/docs/heinloth.txt",1)) x = t(x) #now rows are subjects, cols are genes x = x[order(rownames(x)),] #order by treatment group oxygen, ultra-violet, gamma radiation y = x[26:45,1:10] x = x[2:25,1:10] p = ncol(x); p nx = nrow(x); nx ny = nrow(y); ny n = nx+ny; n # (t(x)-colMeans(x)) %*% t(t(x)-colMeans(x)) T2 = nx*ny/n * t(colMeans(x)-colMeans(y)) %*% solve( ( (nx-1)*cov(x)+(ny-1)*cov(y) )/( n-2 ) ) %*% (colMeans(x)-colMeans(y)); T2 library(ICSNP) HotellingsT2(y,x) http://en.wikipedia.org/wiki/Hotelling's_T-square_dis...
2008 May 23
2
New York Asterisk Users
This is an email to all New York based Asterisk users. For some time it's been bugging me that we don't have a local contact point/user community. If you are involved in Asterisk and in NY/NJ shoot me an email, I'm going to try and revitalize either meetup.com or some other shared environment for Asterisk users in NY. Shoot me an email and once I get an idea of how many Asterisk users there are in NY we'll work out what to do from there. Cheers, Dean -------...
2001 Oct 17
2
File reading.
....5 651.0 651.5 652.0 652.5 653.0 653.5 654.0 5> 654.5 655.0 655.5 656.0 656.5 657.0 657.5 658.0 658.5 ... 7> 1599.5 1600.0 8> 9> 1 1 0 10> Xtemp.wf 11> 2 12> Xtemp.noise 13> 4 14> Xtemp.Sa --- Line 1 contains 2 numbers (nx, ny) which can easily be read using scan. If nx>0 then there are nx values to be read next (i.e. lines 2 and 3 have 39 values). Likewise, with ny>0, lines 4-7 give 1901 values. However, if nx or ny are less than 0, then the data block for lines 2-3 or lines 4-7 will not be present and a generic...
2005 Mar 23
1
interp.surface() error (PR#7745)
...(a, loc) : subscript out of bounds Since it is somewhat dependent on the data set, I cannot say exactly in which cases these occur, but I believe I have found the problem and a solution for it: The scaling calculations in the code, lx <- ((nx - 1) * (loc[, 1] - xa))/xr + 1 ly <- ((ny - 1) * (loc[, 2] - ya))/yr + 1 can lead to numerical error, so in the following lines lx1 <- ifelse(lx == nx, nx - 1, trunc(lx)) ly1 <- ifelse(ly == ny, ny - 1, trunc(ly)) the equality statements which are the first arguments to the IF-ELSE statements return false when they are suppo...
2007 Dec 11
1
R computing speed
...at). However, the computer (I have an Athlon XP 3200+ with 512 GB ram) takes quite a while to estimate the model. With 3 categories, 5 explanatory variables and roughly 5000 observations it takes 2-3 min. For 10 categories and 10 explanatory variables (still 5000 obs) more than 1 hour. Is there any way I can speed up this process? (Modifying the code or modifying some R options maybe?) I would be really grateful if anybody could help me with this issue, I attach my code below. Many thanks, Carlo *************************************** Carlo Fezzi Centre for Social and Economic Research...
2006 Apr 28
2
How to get a grid behind a boxplot
I am using R 2.2.1 on a Windows 2000 PC. When I do a grid() after the boxplot it overprints the boxplot: > boxplot(count ~ spray, data = InsectSprays, col = "lightgray") > grid(nx=NA, ny=NULL) > if I try the panel.first > boxplot(count ~ spray, data = InsectSprays, col = "lightgray", + panel.first=grid(nx=NA, ny=NULL)) > I can see the grid flash and go away. If I close the device and then try the panel.first, I do not get a boxplot and the followin...