search for: hausmann

Displaying 20 results from an estimated 48 matches for "hausmann".

Did you mean: hausman
2009 Mar 02
2
ave and grouping
Dear list, # I have a DF like this: sleep$b <- c(rep(8,10), rep(9,10)) sleep$me <- with(sleep, ave(extra, group, FUN = mean)) sleep # I would like to create a new variable # holding the b-th value of group 1 and 2. # This is not what I want, it takes always the '8' from group '1' # and not the '9' sleep$gr <- with(sleep, ave(extra, group, FUN = function(x)
2002 Sep 11
3
accolade
I've been using R for several months now, in fact it was my intro to "real" computer programming. It used to frustrate me no end, but lately I've noticed my reaction has changed. Nowadays its much more like "wow, is that cool, or what?". So I guess I've gotten over the hump of the learning curve. Comparing what I now do with R to my previous hodge-podge of
2002 May 26
3
Read a Time Serie CSV
...:24828 Max. :25252 Max. :25923 [...] This is ok. But I can't plot a single variable by name. > plot(oecd96$gdpcausb) Error in xy.coords(x, y, xlabel, ylabel, log) : x and y lengths differ This works: plot(oecd96[,1]) What's my fault ? Thanks for any help, Patrick Hausmann ------------- Patrick Hausmann Friedrich-Wilhelm Str. 37 - D-28199 Bremen Tel. +49 421 5980631 - Fax. +49 421 5980632 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", &q...
2002 Jun 14
1
data.frame - transform
...951 2 This should be the result: year MEX.gdp BOL.gdp ITA.gdp 1950 2 4 45 1951 5 12 2 Right now I have this code (better - no code): country.label<-names(table(pwt6$country)) result<-data.frame(year=NULL) for(i in country.label) ? Thanks for any help, Patrick ------------- Patrick Hausmann Friedrich-Wilhelm Str. 37 - D-28199 Bremen Tel. +49 421 5980631 - Fax. +49 421 5980632 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]su...
2002 Jul 03
2
Adding text to a plot
...L BEL 77.87497 1.7547546 1.CAN CAN 87.07300 1.3649655 [...] To add labels on points in a plot I call: text(x=u[,2]+chw, y=u[,3], labels=levels(u[,1]), adj=0 ) How can I label only the datapoints for 'CAN' and 'AUS'? Thanks for any help Patrick ------------- Patrick Hausmann Friedrich-Wilhelm Str. 37 - D-28199 Bremen Tel. +49 421 5980631 - Fax. +49 421 5980632 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]su...
2002 Jun 09
1
Logical operators
...servations for the years 1960 and 1998 + where the variable 'rgdpch' has no missing values. The result should be: code;year;rgdpch ALB;1998;3576 ALB;1960;2345 I tried to solve this with logical operators (==), but without any success. Thanks for your help! Patrick ------------- Patrick Hausmann Friedrich-Wilhelm Str. 37 - D-28199 Bremen Tel. +49 421 5980631 - Fax. +49 421 5980632 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]su...
2011 Feb 23
2
list multiplied by a factor / mapply
Dear list, this works fine: x <- split(iris, iris$Species) x1 <- lapply(x, function(L) transform(L, g = L[,1:4] * 3)) but I would like to multiply each Species with another factor: setosa by 2, versicolor by 3 and virginica by 4. I've tried mapply but without success. Any thoughts? Thanks for any idea! Patrick
2005 Apr 21
2
Download advice please!
Sorry, but I'm just an ignorant Linux user! I have a silly question. Situation: Now that R 2.1.0 is out (Thank you, to all concerned!) I'm about to go off and download it and all the packages. What this means in practice is trotting off to my "local" (and brand new) Internet Cafe with some CDs, where I can get the lot over a fast link and burn it onto a CD or two. However,
2002 Jun 06
3
Problem with get.hist.quote (tseries library)....
Hello, I am having a problem with the get.hist.quote command (tseries library) in the Windows version. This problem is not happening is the Linux version (Mandrake 8.2). Attached is the error message, for an example included in the help file. Also the R.Version() details is attached. Please, do you know if there is a workaround ? Thanks, Carlos. ++++++++++++++++++++++++ ERROR MESSAGE
2002 Jun 21
1
rbind
...lt;- b.70[i:(i+1),2:3] af <- log(ja[2,]/ja[1,]) x <- rbind(x,af) But this saves only the last value of 'af' in 'x' > x ARG AUS 1963 -0.06313723 0.04366118 So, how can I preserve the old values of x? Thanks a lot Patrick ------------- Patrick Hausmann Friedrich-Wilhelm Str. 37 - D-28199 Bremen Tel. +49 421 5980631 - Fax. +49 421 5980632 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]su...
2002 Jun 28
1
Transpose a dataframe
...in this structure: year ARG AUS AUT BDI BEL 1960 7493 10484 7438 587 8223 1961 7733 10342 7808 502 8638 1962 7581 10809 7938 555 9021 1963 7108 11357 8212 608 9311 I'm trying the 'reshape' and 't' command, but still failed. Thanks for any help, Patrick ------------- Patrick Hausmann Friedrich-Wilhelm Str. 37 - D-28199 Bremen Tel. +49 421 5980631 - Fax. +49 421 5980632 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]su...
2003 Jun 17
1
Re: R: Problem from Philippe Glaziou
On Mon, 16 Jun 2003 09:56:07 +0200 Patrick Hausmann <p.hausmann at mr-regionalberatung.de> wrote: > Dear Frank, > > I can reproduce the problem from Philippe Glaziou (see attachment). > Maybe this can help. > Best, > Patrick > > Am Wollelager 11 > 27749 Delmenhorst > Tel. 04221 96373-0 > Fax 04221 96373-29...
2011 Jan 10
1
Using combn
Dear list, I want to apply the "table" function to every pair of variables in df and the return should be a list. setwd(123) asd <- data.frame(a1=sample(1:4, 20, replace=TRUE), a2=sample(1:4, 20, replace=TRUE), a3=sample(1:4, 20, replace=TRUE), a4=sample(1:4, 20, replace=TRUE)) with(asd, table(a1, a2)) with(asd, table(a1,
2008 Aug 30
1
strsplit and regexp
Dear list, I am trying to split a string using regexp: x <- "2 Value 34 a-c 45 t" strsplit(x, "[0-9]") [[1]] [1] "" " Value " "" " a-c " "" " t" But I don't want to lose the digits (pattern), the result should be: [[1]] [1] "2" " Value " "34" " a-c "
2010 Jun 21
1
replace NA-values
Dear list, I'm trying to replace NA-values with the preceding values in that column. This code works, but I am sure there is a more elegant way... df <- data.frame(id = c("A1", NA, NA, NA, "B1", NA, NA, "C1", NA, NA, NA, NA), value = c(1:12)) rn <- c(rownames(df[!is.na(df$id),]), nrow(df)+1) rn <-
2011 Mar 24
1
fraction with timelag
Dear r-help, I'm having this DF df <- data.frame(id = 1:6, xout = c(1234, 2134, 234, 456, 324, 345), xin= c(NA, 34,67,87,34, NA)) and would like to calculate the fraction (xin_t / xout_t-1) The result should be: # NA, 2.76, 3.14, 37.18, 7.46, NA I am sure there is a solution using zoo... but I don't know how... Thanks for any help! Patrick
2012 Apr 25
1
Create new Vector based on two colums
Hello, I am trying to get a new vector 'x1' based on the not NA-values in column 'a' and 'b'. I found a way but I am sure this is not the best solution. So any ideas on how to "optimize" this would be great! m <- factor(c("a1", "a1", "a2", "b1", "b2", "b3", "d1", "d1"), ordered
2008 May 17
1
tapply and grouping
Hello all, I have a df like this: w <- c(1.20, 1.34, 2.34, 3.12, 2.89, 4.67, 2.43, 2.89, 1.99, 3.45, 2.01, 2.23, 1.45, 1.59) g <- rep(c("a", "b"), each=7) df <- data.frame(g, w) df # 1. Mean for each group tapply(df$w, df$g, function(x) mean(x)) # 2. Range for each group - fix value 0.15 tapply(df$w, df$g, function(x) x[(x > mean(x) -
2012 Jun 02
2
Add a dim to an array
Dear list, I'm trying to add a new dim to a multidimensional array. My array looks like this a1 <- array(1:8, c(2, 2, 2)) dimnames(a1) <- list(A = c("A1", "A2"), B = c("B1", "B2"), D = c("D1", "D2")) I would like to add a new dim 'group' with the value "low".
2009 Jan 13
2
NA-values and logical operation
Dear list, as a result of a logical operation I want to assign a new variable to a DF with NA-values. z <- data.frame( x = c(5,6,5,NA,7,5,4,NA), y = c(1,2,2,2,2,2,2,2) ) p <- (z$x <= 5) & (z$y == 1) p z[p, "p1"] <-5 z # ok, this works fine z <- z[,-3] p <- (z$x <= 5) & (z$y == 2) p z[p, "p2"] <-5 z # this failed... - how