Displaying 20 results from an estimated 200 matches similar to: "cbind and mean by week"
2008 Jul 04
2
create a zero matrix & fill
Dear R user,
I have written a function which returns max,min and variation of a power
(see below)
Power is a given matrix(1,n)
I call the function
>Variation<-VAR(p,(n-deltat))
Now the problem is when I want plot(Results[1],Results[2]). Not possible!
I become the following error (in english it means: Error in
as.double.default(x) :Object cannot be transformed in double)
>
2007 Dec 28
1
logistic mixed effects models with lmer
I have a question about some strange results I get when using lmer to
build a logistic mixed effects model. I have a data set of about 30k
points, and I'm trying to do backwards selection to reduce the number
of fixed effects in my model. I've got 3 crossed random effects and
about 20 or so fixed effects. At a certain point, I get a model (m17)
where the fixed effects are like this
2008 Jul 04
1
initialize a matrix
Dear R users,
I'm trying to write a function which returns minimum,maximum,mean of a
vector(power)
I've done the following :
VAR<-function(power,length){
for(i in tml:length)){
tvar[i]<-i
pmean[i]<-mean(power[i:i+deltat])
pmin[i]<-min(power[i:i+deltat])
pmax[i]<-max(power[i:i+deltat])
varmax[i]<-100*(pmax[i]-pmean[i])/pmean[i]
2020 May 20
2
Precision of function mean,bug?
Hello R-dev,
Yesterday, while I was testing the newly implemented function pmean in
package kit, I noticed a mismatch in the output of the below R expressions.
set.seed(123)
n=1e3L
idx=5
x=rnorm(n)
y=rnorm(n)
z=rnorm(n)
a=(x[idx]+y[idx]+z[idx])/3
b=mean(c(x[idx],y[idx],z[idx]))
a==b
# [1] FALSE
For idx= 1, 2, 3, 4 the last line is equal to TRUE. For 5, 6 and many
others the difference is small
2020 May 20
2
Precision of function mean,bug?
> On Wednesday, May 20, 2020, 7:00:09 AM EDT, peter dalgaard <pdalgd at gmail.com> wrote:
>
> Expected, see FAQ 7.31.
>
> You just can't trust == on FP operations. Notice also
Additionally, since you're implementing a "mean" function you are testing
against R's mean, you might want to consider that R uses a two-pass
calculation[1] to reduce floating
2008 Jul 04
0
RES: initialize a matrix
You have to put the tml in the function and deltat too.
like
VAR<-function(power,length,deltat,tml){
-----Mensagem original-----
De: r-help-bounces em r-project.org [mailto:r-help-bounces em r-project.org]Em
nome de mysimbaa
Enviada em: sexta-feira, 4 de julho de 2008 11:22
Para: r-help em r-project.org
Assunto: [R] initialize a matrix
Dear R users,
I'm trying to write a function
2011 Mar 15
4
Element by element mean of a list of matrices
Hi All,
is there any effiective and dense/compact method to calculate the mean of a list of - of course coincident - matrices on an element by element basis? The resulting matrix' [i, j]-th element is the mean of the list's matrices' [i, j]-th elements respectively...
Iterating by for statement is quite straightforward, but I am seeking for a more elegant solution, and my attempt with
1998 Oct 16
3
mean and sd of each serial position
I want to do something like this in R. If I have three vectors
> a1
[1] 1 2 3
> a2
[1] 4 5 6
> a3
[1] 9 10 7
I want to compute
1. A vector that is the mean at each serial position of a1, a2, and a3.
so in this example it would have the contents
4.667, 5.667, 5.333333
2. A vector that is the SD at each serial position of a1, a2, and a3.
so in this example it would have the contents
2004 Apr 27
4
Problems raised to 1/3 power and NaN
I am debugging some code and found a function that returns and error most of the time. I have issolated the problem to when it raises an argument to the 1/3 power but for the life of me I can not figure out why it is not working. i have gone through the FAQs and have found nothing (not to say I might have missed something). I am highly embarrased with my inability find the problem (my face is
2020 May 20
0
Precision of function mean,bug?
Expected, see FAQ 7.31.
You just can't trust == on FP operations. Notice also
> a2=(z[idx]+x[idx]+y[idx])/3
> a2==a
[1] FALSE
> a2==b
[1] TRUE
-pd
> On 20 May 2020, at 12:40 , Morgan Morgan <morgan.emailbox at gmail.com> wrote:
>
> Hello R-dev,
>
> Yesterday, while I was testing the newly implemented function pmean in
> package kit, I noticed a mismatch
1999 Aug 03
1
legend in coplot output
Dear friends:
It's possible make a legend in the coplot output?
My data are:
"dados"<-structure (list (
Qu1 = c(1,2,3,4,5,6,7,8,3,2),
Qu2 = c(3,4,5,6,7,8,9,9,6,3),
Ku1 = structure (factor ( c(1,1,1,1,2,1,2,2,1,1),levels=1:2),.Label=c("Kmin","Kmax")),
Ph1 = structure (factor (
2020 May 21
0
Precision of function mean,bug?
Sorry, posting back to the list.
Thank you all.
Morgan
On Thu, 21 May 2020, 16:33 Henrik Bengtsson, <henrik.bengtsson at gmail.com>
wrote:
> Hi.
>
> Good point and a good example. Feel free to post to the list. The purpose
> of my reply wasn't to take away Peter's point but to emphasize that
> base::mean() does a two-pass scan over the elements too lower the impact
2011 Oct 05
2
mean of 3D arrays
Hi,
I have multiple three dimensional arrays.
Like this:
x1 <- array(rnorm(1000, 1, 2), dim=c(10, 10, 10))
x2 <- array(rnorm(1000, 1, 2), dim=c(10, 10, 10))
x3 <- array(rnorm(1000, 1, 2), dim=c(10, 10, 10))
Now I would like to compute the mean for each corresponding cell.
As a result I want to get one 3D array (10 x 10 x 10) in which at position x, y, z is the mean of the
2018 May 15
0
Systemfit
... and the mailing list is picky about attachments... whatever you attached did not conform to the stringent requirements mentioned in the Posting Guide. Pasting the code right into the email is usually safest, though you DO have to post using plain text (as the Posting Guide indicates) or your code may get mangled by the automatic html format removal.
On May 15, 2018 7:04:31 AM PDT, Bert Gunter
2018 May 15
1
Systemfit
Unless there is good reason not to, always cc the list -- there are lots of
smarter folks than I on it who can help.
I may or may not have time to look at this. Hopefully someone else will.
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip
2006 Sep 21
1
Problems with making a complex graphic
En innebygd og tegnsett-uspesifisert tekst ble skilt ut...
Navn: ikke tilgjengelig
Nettadresse: https://stat.ethz.ch/pipermail/r-help/attachments/20060921/b479a8df/attachment.ksh
2018 May 15
2
Systemfit
OK, Let's try this again! Here is the reproducible script; it is long because I had to copy the panel dataset here. My question is related to systemfit; I don't know how to get the result for the entire panel.
#Reproducible script
Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv")
View(Empdata)
install.packages("systemfit")
2018 May 16
0
Systemfit
Sadly you failed to set your email program to send plain text and the data is corrupted at my end.
I also think you need to reduce the size of the data set... the intent here is to increase your understanding, not debug your particular analysis.
I will say that I am having a very challenging time understanding what you are trying to accomplish though. What are the equations that you think need
2006 Feb 05
3
reading in a tricky computer program output
Hi R user
I need to read in some values from a computer program output.
I can't change the output format because the developer of the program
doesn't allow to change the format of output.
There are two formats.
First one looks like this
if I have 10 variables,
------------------------------------------------------------------------------------------------------
[ 1]
2018 May 16
1
Systemfit Question
I can't get my simultaneous equations to work using system fit. Please help.
#Reproducible script
Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv")
View(Empdata)
str(Empdata)
Empdata$gnipc<-as.numeric(Empdata$gnipc)
install.packages("systemfit")
library("systemfit")
pdata <- plm.data(Empdata,