Displaying 20 results from an estimated 3000 matches similar to: "Amelia. Imputation of time-series data"
2012 Oct 30
1
Amelia imputation - column grouping
Hi everybody,
I am quite new to data imputation, but I would like to use the R package '
Amelia II: A Program for Missing Data '. However, its unclear to me how
the input for amelia should look like:
I have a data frame consisting of numerous coulmns, which represent
different experimental conditions, whereby each column has 3 replicates. I
want amelia to perform an imputation across
2012 Feb 21
0
Running Amelia with parallel processors in Windows
Hi,
I want to impute a data set multiple times with Amelia, but the data set is
large so it takes a long time. As a result, I'm trying to run the multiple
imputation with parallel processors in Windows, but am having trouble. Here
is a quick example:
######
library(foreach)
library(doSNOW)
registerDoSNOW(makeCluster(4, type = "SOCK"))
getDoParWorkers()
getDoParName()
2023 Dec 07
4
Convert character date time to R date-time variable.
Colleagues,
I have a matrix of character data that represents date and time. The format of each element of the matrix is
"2020-09-17_00:00:00"
How can I convert the elements into a valid R date-time constant?
Thank you,
John
John David Sorkin M.D., Ph.D.
Professor of Medicine, University of Maryland School of Medicine;
Associate Director for Biostatistics and Informatics,
2024 Nov 27
3
Convert string to date time
I am reading a string that has the following form:
"2020-08-26_05:15:01"
I want to convert the string to a date-time variable. I tired:
x <- "2007-02-01_10:10:30"
x <- as.POSIXct(x,tz=Sys.timezone())
x
but this did not work; the time portion was ignored. I suspect the problem is the _ between the date and time, but I don't know how to account for this character in
2025 May 23
2
Why is there no macro facility for R?
Colleagues,
At the risk of being flamed, starting a war, being labeled a heretic . . . etc., I would like to ask the grey-hairs among the R listserve members a simple question. Why did the R core team not develop a macro language for R. I understand that R was designed to be a function-based language, but this does not rule out having macros as a facility that helps in code development.
Thank
2023 Dec 07
1
Convert character date time to R date-time variable.
?s 16:21 de 07/12/2023, Sorkin, John escreveu:
> Colleagues,
>
> I have a matrix of character data that represents date and time. The format of each element of the matrix is
> "2020-09-17_00:00:00"
> How can I convert the elements into a valid R date-time constant?
>
> Thank you,
> John
>
>
>
> John David Sorkin M.D., Ph.D.
> Professor of
2023 Dec 07
1
Convert character date time to R date-time variable.
Look at the lubridate package in R.
Regards,
Tim
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Sorkin, John
Sent: Thursday, December 7, 2023 11:22 AM
To: r-help at r-project.org (r-help at r-project.org) <r-help at r-project.org>
Subject: [R] Convert character date time to R date-time variable.
[External Email]
Colleagues,
I have a matrix of
2024 Jan 04
1
Obtaining a value of pie in a zero inflated model (fm-zinb2)
I am running a zero inflated regression using the zeroinfl function similar to the model below:
fm_zinb2 <- zeroinfl(art ~ . | ., data = bioChemists, dist = "poisson")
summary(fm_zinb2)
I have three questions:
1) How can I obtain a value for the parameter pie, which is the fraction of the population that is in the zero inflated model vs the fraction in the count model?
2) For
2025 May 23
1
Why is there no macro facility for R?
R is closely modelled on S. S was always designed to interoperate
well with UNIX tools.
Unix has always had cpp (for c-like languages) and m4
(general-purpose) as outboard macro processors.
Then too, the classic S Blue Book explained how to do "computing on
the language'",
see section 5 of R Language Definition,
so the AST-based macro processor for R is called (drum roll please) R.
2013 Jan 07
1
Amelia algorithm
Dear all.
First of all, my english isn't verry good, but I hope I can convey my concern.
I've a general question about the Amelia algorithm. I'm no mathematician or
statistician, but I had to use R and impute and analyse some data, and Amelia
showed results that fitted my expectations. I'll have to defend my choice soon,
but I haven't totally grasped what Amelia does. I'm
2024 May 09
2
Print date on y axis with month, day, and year
I am trying to use ggplot to plot the data, and R code, below. The dates (jdate) are printing as Mar 01, Mar 15, etc. I want to have the date printed as MMM DD YYYY (or any other way that will show month, date, and year, e.g. mm/dd/yy). How can I accomplish this?
yyy <- structure(list(
jdate = structure(c(19052, 19053, 19054, 19055,
19058, 19059, 19060, 19061, 19062,
2023 Dec 08
1
Convert character date time to R date-time variable.
On 12/7/23 08:21, Sorkin, John wrote:
> Colleagues,
>
> I have a matrix of character data that represents date and time. The format of each element of the matrix is
> "2020-09-17_00:00:00"
> How can I convert the elements into a valid R date-time constant?
You will not be able to store these datetime values in an R matrix, at
least as class POSIXct. You could with class
2023 Dec 08
1
Convert two-dimensional array into a three-dimensional array.
Colleagues
I want to convert a 10x2 array:
# create a 10x2 matrix.
datavals <- matrix(nrow=10,ncol=2)
datavals[,] <- rep(c(1,2),10)+c(rnorm(10),rnorm(10))
datavals
into a 10x3 array, ThreeDArray, dim(10,2,10).
The values storede in ThreeDArray's first dimensions will be the data stored in datavalues.
ThreeDArray[i,,] <- datavals[i,]
The values storede in ThreeDArray's second
2024 Jun 08
1
Can't compute row means of two columns of a dataframe.
Use apply(), not by().
xxxz$av20 <- apply(xxxz[,c("Low20","High20")],1, mean)
-- Bert
On Sat, Jun 8, 2024 at 10:38?AM Sorkin, John <jsorkin at som.umaryland.edu>
wrote:
> I have a data frame with three columns, TotalInches, Low20, High20. For
> each row of the dataset, I am trying to compute the mean of Low20 and
> High20.
>
> xxxz <-
2024 Dec 06
1
ggplot2: Plot multiple lines using stacked data.
I am trying to use ggplot2 to create a figure with multiple lines, one line for each value of the variable Day. Each group of data for Day requires seven lines. The dataframe has data for 4 days and thus 4*7=28 lines.
I can create a plot, but the plot only contains dots. The dots for each day should be connected each day's data by a different line. There should be a total of four lines on the
2011 Jul 22
0
Using package amelia
Hello
I do not think I have fully grasped how to use Amelia to deal with missing
data.
For instance, suppose I have a data.frame variable with 4 columns (year,
mon, ssn, dev) = (year, month, measurements, standard deviation of the
measurement). Of course, there are some random missing values on columns 3
and 4. The measurements are an almost periodic time-series contaminated by
noise.
2025 Jan 24
2
Interpreting the output of str on a data frame created using aggregate function
I'll answer your question inline.
On 2025-01-24 2:03 p.m., Sorkin, John wrote:
> I ran the following code:
> marginalcats <- aggregate(meanbyCensusIDAndDay3$cats,
> list(meanbyCensusIDAndDay3$CensusID),table)
> followed by
> str(marginalcats)
>
> I received the following output:
> 'data.frame': 844 obs. of 2 variables:
> $
2024 Nov 29
3
Trying to get the prior value of a record from a data.frame . . . data.frame
I need to write code that will give me the previous value of from a data.frame. I have written the following code using the shift function from data.table . It does not work. I hope someone can help me correct the code.
###########################
# Try to understand shift #
###########################
if(!require(data.table)) install.packages("data.table")
library(data.table)
# Create
2024 Dec 02
1
Identify first row of each ID within a data frame, create a variable first =1 for the first row and first=0 of all other rows
OK.
(Note: I am ccing this to the list so that others can correct any
mistakes, misunderstandings, or misstatements that I may make; and
also give you more and better advice about how to proceed. For
example, there may be environmental packages ( see the environmetrics
task view, https://CRAN.R-project.org/view=Environmetrics) that
already do everything you want from your data source that someone
2023 Oct 24
1
by function does not separate output from function with mulliple parts
Colleagues,
I have written an R function (see fully annotated code below), with which I want to process a dataframe within levels of the variable StepType. My program works, it processes the data within levels of StepType, but the usual headers that separate the output by levels of StepType are at the end of the listing rather than being used as separators, i.e. I get
Regression results StepType