Hi R-Help,
I'm replicating IV-GMM models from Stata in R, but get small differences in
coefficients (eg 100.0 vs 100.3); I'm hoping somebody can share anything
they've learned attempting the same thing. The linear models match
exactly, so there isn't a data problem. With both help files I've matc
Hello R-Helpers,
I'm trying to to create a subtotal category for each column in a
dataset, and totals of subtotals, resulting in one data frame. I
figure I could do this by a whack of aggregate() and rbind(), but I'm
hoping there is a simpler way.
Below is a sample dataset. Underneath I create a
is still a loop (via apply), however, so it may not
> satisfy your efficiency needs.
>
> Cheers,
> Bert
>
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breat
indInterval is a fast way to do this.
>
> ... I think.
>
> If you try this, let me know (perhaps privately) how/if it works.
>
> Cheers,
> Bert
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it.&q
Hello, I have a dataframe with a date range, and another dataframe
with observations by date. For each date range, I'd like to average
the values within that range from the other dataframe. I've provided
code below doing what I would like, but using a for loop is too
inefficient for my actual cas
Dear R-Helpers
I am attempting to get a legend in the outer margins of a graph that has a
similar flexibility to mtext(), within base graphics. This is used in a
tool that will end up with graphs of many different coordinates, exported
in many different sizes. I'm trying to come up with a genera
Hello,
I'm creating graphs like the following:
x <- seq(as.POSIXct("2012-01-01"), as.POSIXct("2013-01-01"), by = "days")
y <- (1:length(x)*10 + cumsum(rnorm(n=length(x), mean=0, sd= 100)))
plot(x,y, type = 'l', xaxt='n')
axis.POSIXct(side=1,at=seq(min(x), max(x), by="months"), format = "%b
\'%y
check out: demo("plotmath")
On Tue, Oct 15, 2013 at 4:30 PM, arun wrote:
> Hi,
> Try:
> plot(1,main=bquote("Pareto Distribution: " ~ alpha == 2 * ","
> ~italic(y[m]) == 3))
>
>
> A.K.
>
>
> Hi,
>
> I'd like to put the following in a main title of a plot.
>
>
>
> Can someone show me how to do t
I don't fully understand what you are looking for, but you may want to
check out ?predict, ?predict.lm
On Sat, Aug 24, 2013 at 7:43 AM, alR wrote:
> I have fitted a multiple regression model to the row of a matrix using lm:
>
> ft<-lm(datos[i, ]-r1 + r2+ r3 + r4,keep.data = TRUE,model=TRUE)
>
>
t;
> x[are.equal(x, 0.15)]
>
>
> Hope this helps,
>
> Rui Barradas
>
> Em 30-05-2013 02:27, Peter Lomas escreveu:
>
>> Hello,
>>
>> I have a whole bunch of data to two decimal places. I've done some
>> arithmetic with them, so floating point be
Not sure whether your data is just 0's and 1's, but something like this may
also work for you:
imm <- 1*(speciesTime2[ , 2:4] == 1 & speciesTime2[ , 2:4] != speciesTime1[
, 2:4])
imm <- cbind(imm, sum = rowSums(imm))
Exti <- 1*(speciesTime2[ , 2:4] == 0 & speciesTime2[ , 2:4] !=
speciesTime1[ , 2
Hello,
I have a whole bunch of data to two decimal places. I've done some
arithmetic with them, so floating point becomes an issue.
x <- c(1, 0.15,(0.1+.05),0.4)
I want to do something like this:
x[x==0.15]
But you'll notice that is troublesome with the well known floating point
issue. So re
Dear R Users,
I have to read data from many excel spreadsheets, all which have some
frustrating formatting (lots of titles, headers, etc.). I am trying
to work directly from source data and the number of the spreadsheets I
would have to go through make reformatting one by one a pain. I have
foun
Hi Jim,
Perhaps somebody else knows a smoother way, but in the past I have
just built my table in R as a matrix then used xtable. Here's what I
would do with your example:
library(xtable)
dataset1 = matrix( c(1,2,3,4, 5, 6 ), 2 , 3)
dataset2 = matrix( c(4,3,5,10, 1, 0), 2, 3)
dataset <- rbind(d
On Tue, Jul 19, 2011 at 17:34, Nordlund, Dan (DSHS/RDA)
wrote:
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
>> project.org] On Behalf Of Peter Lomas
>> Sent: Tuesday, July 19, 2011 2:16 PM
>> To: r-help@r-project.org
>>
Hi R-Help!
I am trying to find a nicer way of extracting all the "complete" diagonals
of a matrix. I am working with very large matrices that have many more rows
than columns. I want to be able to extract each of the diagonals that are
as long as the number of columns in the matrix. I have writ
Hi Richard,
As others have said, try to use the "apply" functions rather than loops.
There is also an apply function for lists, see ?lapply. This is much more
efficient. I also like writing my own functions. For example:
f <- function(x) {
x^2
}
Which can then be used by:
> f(2)
[1] 4
Thi
17 matches
Mail list logo