For this kind of plot I usually use day-of-month for for the x-axis instead of
a date or timestamp.
--
Sent from my phone. Please excuse my brevity.
On May 9, 2017 6:55:27 PM PDT, Jeff Reichman wrote:
>r-help
>
>
>
>Trying to figure out how to plot by month bar charts. The follow code
>plots
Hello,
I am a newbie to R and GLMM and having a difficult time
understanding the model design that best captures my test scenario.
I am interested in the following question:
1. whether average values of a variable explain a certain response
lesser than individual values.
1.1. For this, I have a
r-help
Trying to figure out how to plot by month bar charts. The follow code plots
the monthly portion on a yearly x-scale. So I either I create 12 individual
month plots or maybe there is some sort of "break" to tell R separate by
month and use the months dates as the x-scale; so that Jan's s
Of course, and I neglected to point this out:
"The other thread" would be how to properly impute missing values,
"The other site" could be https://stats.stackexchange.com/
... there is _lots_ of information available if you search for it.
An applicable R Package is MICE and you can find an introd
Of course, statistically, one should not do this. But that's another thread
on another site.
Cheers,
Bert
On May 9, 2017 3:36 PM, "Boris Steipe" wrote:
Great.
I am CC'ing the list - this is important so that others who may come across
this thread in the archives know that this question has b
Hi,
I want to estimate the cluster SE of a differences-in-differences
panel model with 100 groups, 6,156 individuals and 15 years. Some of
the individuals are repeated (4,201 unique) because they are part of a
matched sample obtained with a one-to-one, with replacement, matching
method.
I have been
Great.
I am CC'ing the list - this is important so that others who may come across
this thread in the archives know that this question has been resolved.
Cheers,
B.
> On May 9, 2017, at 5:18 PM, Olu Ola wrote:
>
> Thank you!!! It worked.
>
> Regards,
> Olu
>
>
> On Tuesday, May 9, 2017
Inline...
> On 9 May 2017, at 12:12 , g.maub...@weinwolf.de wrote:
>
> Hi All,
>
> I am using factors in a study for the social sciences.
>
> I discovered the following:
>
> -- cut --
>
> library(dplyr)
>
> test1 <- c(rep(1, 4), rep(0, 6))
> d_test1 <- data.frame(test)
>
> test2 <- factor(t
> On May 9, 2017, at 2:33 PM, David Winsemius wrote:
>
>
>> On May 9, 2017, at 2:05 PM, Czarek Kowalski wrote:
>>
>> I have already posted that in attachement - pdf file.
>
> I see that now. I failed to scroll to the 3rd page.
>
>> I am posting
>> plain text here:
>>
>>> library(tmvtnorm)
> On May 9, 2017, at 2:05 PM, Czarek Kowalski wrote:
>
> I have already posted that in attachement - pdf file.
I see that now. I failed to scroll to the 3rd page.
> I am posting
> plain text here:
>
>> library(tmvtnorm)
>> meann = c(55, 40, 50, 35, 45, 30)
>> covv = matrix(c( 1, 1, 0, 2, -1,
I have already posted that in attachement - pdf file. I am posting
plain text here:
> library(tmvtnorm)
> meann = c(55, 40, 50, 35, 45, 30)
> covv = matrix(c( 1, 1, 0, 2, -1, -1,
+ 1, 16, -6, -6, -2, 12,
+ 0, -6, 4, 2, -2, -5,
+ 2, -6, 2,
Pedestrian code, so you can analyze this easily. However entirely untested
since I have no ambitionto recreate your input data as a data frame. This code
assumes:
- your data _is_ a data frame
- the desired column is called food.price, not "food price" (cf. ?make.names )
# define a function th
> On May 9, 2017, at 1:11 PM, Czarek Kowalski wrote:
>
> Of course I have expected the difference between theory and a sample
> of realizations of RV's and result mean should still be a random
> variable. But, for example for 4th element of mean vector: 35.31 -
> 34.69571 = 0.61429. It is quite
Of course I have expected the difference between theory and a sample
of realizations of RV's and result mean should still be a random
variable. But, for example for 4th element of mean vector: 35.31 -
34.69571 = 0.61429. It is quite big difference, nieprawdaż? I have
expected that the difference wo
> On May 9, 2017, at 10:09 AM, Czarek Kowalski wrote:
>
> Dear Members,
> I am working with 6-dimensional Student-t distribution with 4 degrees
> of freedom truncated to [20; 60]. I have generated 100 000 samples
> from truncated multivariate Student-t distribution using rtmvt
> function from pa
myDf1 <- data.frame(drugs = c("Ibuprofen", "Simvastatin", "Losartan"),
indications = c("pain", "hyperlipidemia", "hypertension"),
stringsAsFactors = FALSE)
myDf2 <- data.frame(drugs = c("Simvastatin", "Losartan", "Ibuprofen",
"Metformin"),
Hello,I have the following food data with some NA values in the food prices. I
will like to replace the NA values in the food price column for each food item
by the mean price of the specific food item for each city. For example, the
price of bean for the household with hhid 102 in the data set
Seems so simple when you explain it. Thanks very much. Gerard
> On May 9, 2017, at 9:40 AM, Ulrik Stervbo wrote:
>
> Hi Gerard,
> Quotation marks are used for strings. In you function body you try to use the
> strings "indata" and "fig_descrip" (the latter will work but is not what you
> wa
Hi Ulrik,
If I can trouble you with one more question.
Now trying to send a string to the main= . I was able to pass the data name in
data=in_data, but same logic is not working in passion the main string.
plot_f1 <-function(indata,n1,n2,n3,fig_descrip) {
par(oma=c(2,2,2,2))
boxplot(formu
Hi Ulrik,
That worked perfectly. Thanks for your help. Much appreciated.
Gerard
> On May 8, 2017, at 11:40 PM, Ulrik Stervbo wrote:
>
> HI Gerard,
>
> You get the literals because the variables are not implicitly expanded -
> 'Placebo(N=n1) ' is just a string indicating the N = n1.
>
>
I'm repeating my question and hope to find someone to help.
I have been trying for hours but without results, I have done previous
suggestions but still struggling.
I believe that join functions in dplyr will do the work but I'm confusing with
the correct syntax.
I have 2 tables and I'm try
Am Tue, 09 May 2017 10:00:17 -0700
schrieb Jeff Newmiller :
> This boils down to the fact that some "my ways" are more effective in
> the long run than others.. but I really want to address the complaint
>
> "... sometimes tedious to rebuild my environment by reexecuting
> commands in the history
This boils down to the fact that some "my ways" are more effective in the long
run than others.. but I really want to address the complaint
"... sometimes tedious to rebuild my environment by reexecuting commands in the
history"
by asserting that letting R re-run a script that loads my function
On 09/05/2017 12:06 PM, Keith Jewell wrote:
I'm very hesitant to suggest that there's a bug in such a venerable R
function, but I can't see what I'm doing wrong. Any comments are welcome
Yes, it looks like a bug. One other thing I find a little strange: the
starting directory seems wrong when
Hi Gerard,
Quotation marks are used for strings. In you function body you try to use
the strings "indata" and "fig_descrip" (the latter will work but is not
what you want).
In your current function call you pass the variable Figure as the value to
the argument fig_descrip, followed by a lot of ot
Dear Lily,
Harold is telling you to type "?round" at the R command prompt to pull
up the "round" help page.
>?round
>help("round")
AFAIK, the above two commands are equivalent, in general.
Best, Bill.
W. Michels, Ph.D.
On Tue, May 9, 2017 at 8:11 AM, Doran, Harold wrote:
> ?round
>
>
> Fro
I'm very hesitant to suggest that there's a bug in such a venerable R
function, but I can't see what I'm doing wrong. Any comments are welcome
When using choose.files() where:
default = something
multi = FALSE
selected file path is shorter than the default
... then the returned value
Ralf:
You are afflicted with several mind bugs:
* the "my-way mind bug" -- "I want to do it MY WAY, because that's sort
of what
I know" and also,
* the "my-square-peg-should-fit-into-this-round-hole mind bug" -- "R
should be able to
do it MY WAY, but it puts obstacles in my path," perhaps a su
yes, I just tried for the dataframe and it works, so there is no problem on
this side.
On Tue, May 9, 2017 at 9:14 AM, Doran, Harold wrote:
> Im not sure if you’re asking a question or confirming that it works for
> you. But, obviously, the code below behaves as expected
>
>
>
> *From:* lily li
Im not sure if you’re asking a question or confirming that it works for you.
But, obviously, the code below behaves as expected
From: lily li [mailto:chocol...@gmail.com]
Sent: Tuesday, May 09, 2017 11:13 AM
To: Doran, Harold
Cc: Charles Determan ; R mailing list
Subject: Re: [R] About calcula
Yes, that means to control decimal numbers. For example, use round(2.3122,
digits=1), it gets 2.3
On Tue, May 9, 2017 at 9:11 AM, Doran, Harold wrote:
> ?round
>
>
>
>
>
> *From:* lily li [mailto:chocol...@gmail.com]
> *Sent:* Tuesday, May 09, 2017 11:10 AM
> *To:* Charles Determan
> *Cc:* Dora
?round
From: lily li [mailto:chocol...@gmail.com]
Sent: Tuesday, May 09, 2017 11:10 AM
To: Charles Determan
Cc: Doran, Harold ; R mailing list
Subject: Re: [R] About calculating average values from several matrices
Thanks very much, it works. But how to round the values to have only 1 decimal
Just call 'round' on your results then at your desired number of digits.
On Tue, May 9, 2017 at 10:09 AM, lily li wrote:
> Thanks very much, it works. But how to round the values to have only 1
> decimal digit or 2 decimal digits? I think by dividing, the values are
> double type now. Thanks aga
Thanks very much, it works. But how to round the values to have only 1
decimal digit or 2 decimal digits? I think by dividing, the values are
double type now. Thanks again.
On Tue, May 9, 2017 at 9:04 AM, Charles Determan
wrote:
> If you want the mean of each element across you list of matrices
If you want the mean of each element across you list of matrices the
following should provide what you are looking for where Reduce sums all
your matrix elements across matrices and the simply divided my the number
of matrices for the element-wise mean.
Reduce(`+`, mylist)/length(mylist)
Regards,
I meant for each cell, it takes the average from other dataframes at the
same cell. I don't know how to deal with row names and col names though, so
it has the error message.
On Tue, May 9, 2017 at 8:50 AM, Doran, Harold wrote:
> It’s not clear to me what your actual structure is. Can you provid
It’s not clear to me what your actual structure is. Can you provide
str(object)? Assuming it is a list, and you want the mean over all cells or
columns, you might want like this:
myData <- vector("list", 3)
for(i in 1:3){
myData[[i]] <- matrix(rnorm(100), 10, 10)
I'm trying to get a new dataframe or whatever to call, which has the same
structure with each file as listed above. For each cell in the new
dataframe or the new file, it is the average value from former dataframes
at the same location. Thanks.
On Tue, May 9, 2017 at 8:41 AM, Doran, Harold wrote:
Are you trying to take the mean over all cells, or over rows/columns within
each dataframe. Also, are these different dataframes stored within a list or
are they standalone?
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of lily li
Sent: Tuesday, May 09
Hi R users,
I have a question about manipulating the data.
For example, there are several such data frames or matrices, and I want to
calculate the average value from all the data frames or matrices. How to do
it? Also, should I convert them to data frame or matrix first? Right now,
when I use typ
Am Sat, 6 May 2017 11:17:42 -0400
schrieb Michael Friendly :
> On 5/5/2017 10:23 AM, Ralf Goertz wrote:
> > Am Fri, 05 May 2017 07:14:36 -0700
> > schrieb Jeff Newmiller :
> >
> >> R normally prompts you to save .RData, but it just automatically
> >> saves .Rhistory... the two are unrelated.
>
Hi David,
Hi Bob,
many thanks for your help.
Your solution - just to use all levels instead of just the one's found in
the data - helped.
The original code looked like this:
-- cut --
c_v10_val_labs <- c(
"1 = sehr gut",
"2", "3", "4", "5",
"6 = sehr schlecht"
)
# where c_v10_val_labs
I'm not sure I understand your question, but you can easily include all
possible answers when you create the factor by using the levels= argument as
Bob pointed out. Here is an example of values that range from 1 to 6, but value
3 is not represented. Notice that a factor level 3 is created even
For the problem you state, would it be enough to explicitly define your levels?
fac <- rep(c("a", "b", "d"), each=4)
fac.f <- factor(fac, levels=c("a", "b", "c", "d"))
table(fac.f)
# but be warned...
fac.f2 <- factor(fac.f)
table(fac.f2)
This has the advantage that the code explicitly documents
Hi Bob,
many thanks for your reply.
I have read the documentation. In my current project I use "item
batteries" for dimensions of touchpoints which are rated by our customers.
I wrote functions to analyse them. If I create a factor before filtering
and analysing I lose the original values of t
That's easy! First
> str(test3)
Factor w/ 2 levels "WITHOUT Contact",..: 2 2 2 2 1 1 1 1 1 1
tells you that the internal values are 1 and 2, and the labels are
"WITHOUT Contact" and "WITH Contact". If you read the help page for
factor() you'll see this:
levels: an optional vector of the values (
Hi All,
I am using factors in a study for the social sciences.
I discovered the following:
-- cut --
library(dplyr)
test1 <- c(rep(1, 4), rep(0, 6))
d_test1 <- data.frame(test)
test2 <- factor(test1)
d_test2 <- data.frame(test2)
test3 <- factor(test1,
levels = c(0, 1),
Hi Abo,
Please keep the list in cc.
I think the function documentation is pretty straight forward - two
data.frames are required, and if you wish to keep elements that are not
present in both data.frames, you set the flag all = TRUE. You also have the
option to specify which columns to join by.
48 matches
Mail list logo