Displaying 20 results from an estimated 600 matches similar to: "how to interpolate time series data with missingness"
2007 Jul 27
1
exporting character vector to text files
R-help,
I have a character vector whose elements are the names of matrixes.
Something like this:
> test <- ls(pattern="Oki")
[1] "aaOki" "aOki" "bOki" "c1Oki" "c2Oki" "c3Oki"
"cOki" "dOki" "eOki" "fOki" "gprsOki" "hOki"
2004 Apr 07
4
Problems with rlm
Dear all,
When calling rlm with the following data, I get an error. (R v.1.8.1,
WinXP Pro 2002 with service pack 1.)
> d <- na.omit(data.frame(CPRATIO, HEIGHTZ, FAMILYID))
> c <- tapply(d$CPRATIO, d$FAMILYID, mean)
> h <- tapply(d$HEIGHTZ, d$FAMILYID, mean)
> c
1 2 3 6 7 9 10
11
6.000000 2.500000 3.250000
2005 Aug 05
4
interpolation function
Hi,
I have a sparse matrix.I want to fill values into the entries whose value
is 0.The new generated values should come from the interpolation of the
values have existed.Does R provide such interpolation functions which
operate on Matrix, for example ,such a matrix below
0 0 0 0 2.3 0 0 0 0
0 0 3.1 0 0 0 0 1.4 0
0 0 0 0 0 0 0 0 0
1.1 0 0 0 0 0 0 0 0
0 0 0 4
2019 Oct 01
0
Is missingness always passed on?
Le 30/09/2019 ? 16:17, Duncan Murdoch a ?crit?:
>
> There's a StackOverflow question
> https://stackoverflow.com/q/22024082/2554330 that references this text
> from ?missing:
>
> "Currently missing can only be used in the immediate body of the
> function that defines the argument, not in the body of a nested
> function or a local call. This may change in the
2019 Oct 01
0
Is missingness always passed on?
There is "missing with default" and "missing without default".
If an argument x is missing without a default, then missing(x) is true, if
you pass x to another function, it will pass the value of the "missing
argument". (which is different than simply being missing!)
If an argument x is missing _with_a default, then missing(x) is still true,
but if you pass x to
2009 Feb 09
0
Generating missingness on SNP data
Dear all,
I generated a dataset with 500 unrelated individuals and 10 biallelic
SNPs. From this dataset,I would like to create data with 5% missingness on
genotype information at random and also data with 5% genotyping error.
Can someone help me with how I can do it.
[[alternative HTML version deleted]]
2010 Feb 09
1
"1 observation deleted due to missingness" from summary() on the result of aov()
I have the R code at the end. The last command gives me "1 observation
deleted due to missingness". I don't understand what this error
message. Could somebody help me understand it and how to fix the
problem?
> summary(afit)
Df Sum Sq Mean Sq F value Pr(>F)
A 2 0.328 0.16382 0.1899 0.82727
B 3 2.882 0.96057 1.1136 0.34644
C
2010 Jun 01
0
selecting monotone pattern of missing data from a dataframe with mixed pattern of missingness
Dear R- User,
I have a dataset that looks like the following:
jh<-data.frame(
'id'=seq(1,10,1),
'time0'=c(8,5,8,8,9,NA,NA,2,4,5),
'time4'=c(NA,NA,9,8,NA,2,3,2,4,5),
'time8'=c(NA,2,8,NA,5,NA,2,3,NA,4),
'time12'=c(NA,2,NA,NA,NA,3,3,2,3,NA),
2010 Feb 28
1
"Types" of missingness
Dear R-List,
My questions concerns missing values. Specifically, is is possible to
use different "types" of missingness in a dataset and not a
one-size-fits-all NA?
For example, data may be missing because of an outright refusal by a
respondent to answer a question, or because she didn't know an answer,
or because the item simply did not apply. In later analysis it is
sometimes
2012 Sep 17
2
Creating missingness in repeated measurement data
Dear R users,
I have the following problems. My dataset (dat) is as follows:
a <- c(1,2,3)
id <- rep(a, c(3,2,3))
stat <- c(1,1,0,1,0,1,1,1)
g <- c(0,0,0,0,0,0,1,0)
stop <- c(1,2,4,2,4,1,1.5,3)
dat <- data.frame(id,stat,g,stop)
I want to creat a new dataset (dat2) with missing values
such that when either g = =1 or stat = =0, the remaining rows for an
individual subject
2019 Sep 30
5
Is missingness always passed on?
There's a StackOverflow question
https://stackoverflow.com/q/22024082/2554330 that references this text
from ?missing:
"Currently missing can only be used in the immediate body of the
function that defines the argument, not in the body of a nested function
or a local call. This may change in the future."
Someone pointed out (in https://stackoverflow.com/a/58169498/2554330)
2012 Aug 08
3
Outer product from matrix by row and a vector
Dear all,
I am facing a challenge when applying the outer product with a matrix by rows.
What I have is a rather big matrix, which I would like to convert into a different matrix by doing something like
outer(matrix_row, vector, function(x,y) x[1]+5*x[4]/y)
In order to get there, I tried to get the matrix into a list using the mefa package, as subsetting the original data appears too
2013 Mar 07
1
create vector from indices interpolated values
Readers,
Is it possible to create a plot command based upon the indices of
missing values in a data set?
dataset1<-read.table(text='
10 2
20 NA
30 5
40 7
50 NA
60 NA
70 2
80 6
90 NA
100 9
')
dataset2<-read.table(text='
0.2
0.4
0.1
0.9
0.2
0.3
1.1
0.7
0.9
0.6
0.4
')
The 'approx' function is used to obtain the interpolated values for
'NA' in dataset1.
2005 Oct 06
5
Interpolation in time
Can anybody help me write a code on the following data example, which
fills out all NA values by using a linear interpolation with the two
closest values?
Doy is day of year (%j).
Code example:
yr<-c(rep(2000,14))
doy<-c(16:29)
dat<-c(3.2,NA,NA,NA,NA,NA,NA,5.1,NA,NA,NA,NA,NA,4.6)
ta<-cbind(yr,doy,dat)
ta
yr doy dat
[1,] 2000 16 3.2
[2,] 2000 17 NA
[3,] 2000 18 NA
2011 Jan 27
3
how to divide each element of a matrix by a specific value per column
Hi,
I'd like to divide each element of a matrix by a specific value per column. These specific values are stored in a list. For example:
> x <- c(1,2,3,4,5)
> y <- matrix(c(1:30), nrow = 6)
Now I want to divide each element in y[,1] by x[1], y[,2] by x[2] etc. I have tried this
> my_function <- function(data, ind) data/ind
> apply(y, 2, my_function, x)
[,1] [,2]
2011 Mar 11
5
How to calculate means for multiple variables in samples with different sizes
Hello R-helpers:
I have data like this:
sample replicate height weight age
A 1.00 12.0 0.64 6.00
A 2.00 12.2 0.38 6.00
A 3.00 12.4 0.49 6.00
B 1.00 12.7 0.65 4.00
B 2.00 12.8 0.78 5.00
C 1.00 11.9 0.45 6.00
C 2.00 11.84 0.44 2.00
C 3.00 11.43 0.32 3.00
C 4.00 10.24 0.84 4.00
D
2012 Jul 22
5
Reorder in decreasing order
reorder() is probably the best way to order the levels in a vector
without manually specifying the order. But reorder() orders by default
in an increasing order: "The levels are ordered such that the values
returned by ?FUN? are in increasing order."
Is there a way to do what reorder() does, but order the levels
according to a _decreasing_ order of the values?
Sverre
2007 Dec 05
2
how to interpolate a plot with a logistic curve
hello,
I have this simple question. This is my dataset
size
1 57
2 97
3 105
4 123
5 136
6 153
7 173
8 180
9 193
10 202
11 213
12 219
13 224
14 224
15 248
16 367
17 496
18 568
19 618
20 670
21 719
22 774
23 810
24 814
25 823
I plot it with:
plot(generalstats[,1], type="b", xlab="Mesi", ylab="Numero di
vertici", main="");
and try to interpolate with a
2011 Jan 11
1
Interpolate xts
Hello,
I have a xts object, I would like to fill the NA with linear
interpolated data. Can anyone please help.
> str(zz)
An ‘xts’ object from 2010-11-24 15:59:29 to 2010-11-24 16:00:00 containing:
Data: num [1:23401, 1] 312 312 312 312 312 ...
Indexed by objects of class: [POSIXct,POSIXt] TZ:
xts Attributes:
List of 2
$ src : chr "datafeed"
$ updated: POSIXct[1:1],
2006 Mar 14
1
Interpolate univariate data on regular 3D grid to new 3D grid
Dear R Users,
I have some data that is very similar in form to a 3D image - ie univariate
data on a regular 3D grid. I keep this as a 3D numeric array in R with
attributes describing the sampling points along the 3 dimensions.
I would like to interpolate this onto a new regular 3D grid that I specify
(eg by supplying 3 vectors corresponding to the new grid locations on each
of the 3