search for: missingness

Displaying 20 results from an estimated 173 matches for "missingness".

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 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 useful to be able to distingui...
2010 Apr 04
2
logistic regression in an incomplete dataset
Dear all, I want to do a logistic regression. So far I've only found out how, in a dataset of complete cases. I'd like to do logistic regression via max likelihood, using all the study cases (complete and incomplete). Can you help? I'm using glm() with family=binomial(logit). If any covariate in a study case is missing then the study case is dropped, i.e. it is doing a complete case
2019 Oct 01
0
Is missingness always passed on?
...e 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) > that this isn't true in the examples they've tried:? missingness does > get passed along.? This example shows it (this is slightly different > than the SO example): > > f1 <- function(x, y, z){ > ? if(missing(x)) > ??? cat("f1: x is missing\n") > ? if(missing(y)) > ??? cat("f1: y is missing\n") > } > > f2...
2019 Oct 01
0
Is missingness always passed on?
...iate 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) > that this isn't true in the examples they've tried: missingness does > get passed along. This example shows it (this is slightly different > than the SO example): > > f1 <- function(x, y, z){ > if(missing(x)) > cat("f1: x is missing\n") > if(missing(y)) > cat("f1: y is missing\n") > } > >...
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]]
2017 Dec 19
1
lm considers removed predictors when finding complete cases
Dear R-devel list, I realized that removing a predictor in lm through the "-"'s operator in formula() does not affect the complete cases that are considered. A minimal example is: summary(lm(Wind ~ ., data = airquality)) # 42 observations deleted due to missingness summary(lm(Wind ~ . - Ozone, data = airquality)) # still 42 observations deleted due to missingness, even if only 7 are # missing for the response and the rest of the predictors summary(lm(Wind ~ ., data = subset(airquality, select = -Ozone))) # 7 observations deleted due to missingness I find t...
2019 Sep 30
5
Is missingness always passed on?
...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) that this isn't true in the examples they've tried: missingness does get passed along. This example shows it (this is slightly different than the SO example): f1 <- function(x, y, z){ if(missing(x)) cat("f1: x is missing\n") if(missing(y)) cat("f1: y is missing\n") } f2 <- function(x, y, z){ if(missing(z))...
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),  
2009 Jun 17
1
how to interpolate time series data with missingness
Hi all, I have a vector, most of which is missing. The data is always increasing, but may do so in jumps. I would like to interpolate the NAs with 'best guesses', using something like filter(), which doesn't work due to the NAs. Here is an example: > x <- c(2,3,NA,NA,NA,3.2,3.5,NA,NA,6,NA) > x [1] 2.0 3.0 NA NA NA 3.2 3.5 NA NA 6.0 NA I would like a function that
2012 Oct 02
2
Problem with mutli-dimensional array
I want to make a multi-dimensional array. To be specific I want to make the following array results<-array(0,dim=c(2,2,64,7)) This is the code I have created but it gives no result due to the error "subscript out of bound". x<-rep(7,7) # Missingness in intervention y<-rep(7,7) # Missingness in control arraynames<-list(Group=c("Success","Failure"),Outcome=c("Intervention","Control"),Trial=c("1":"7")) mat.stat<-array(c(9,16,10,15,66,12,44,23,102,88,66,104,277,60,247,119,23,43,...
2007 Jun 15
2
method of rpart when response variable is binary?
...is better to divide x into intervals and change it to a factor before calling glm(y~x,data=dat,family=binomail). I try to use rpart. As y is binary, I use "class" method and get the following result. > rpart(y~x,data=dat,method="class") n=778 (22 observations deleted due to missingness) node), split, n, loss, yval, (yprob) * denotes terminal node 1) root 778 67 0 (0.91388175 0.08611825) * If with the default method, I get such a result. > rpart(y~x,data=dat) n=778 (22 observations deleted due to missingness) node), split, n, deviance, yval * denotes terminal...
2008 Aug 01
1
importing explicitly declared missing values in read.spss (foreign)
...re recognized as missing values, the others are just imported as levels in the nominal case, and as (labeled) real values 8 and 9 in the continuous case. There are also no attributes in the object returned by read.spss that contain information about which values/levels are the missing values; their missingness seems to be completely ignored by the function. Is there some way or other function to be able to import spss files, with an option that replaces all missing values with <NA>'s in R? Of course this comes with the trade-off of losing the meaning of the missingness when there are multiple...
2011 Aug 01
1
Impact of multiple imputation on correlations
...o handle missing data in my study. I use the mice package in R for this. The deeper I get into this process, the more I realize I first need to understand some basic concepts which I hope you can help me with. For example, let us consider two arbitrary variables in my study that have the following missingness pattern: Variable 1 available, Variable 2 available: 51 (of 118 observations, 43%) Variable 1 available, Variable 2 missing: 37 (31,3%) Variable 1 missing, Variable 2 available: 10 (8,4%) Variable 1 missing, Variable 2 missing: 20 (16,9%) I am interested in the correlation between Variable 1 and...
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
2009 Dec 02
1
Generate missing data patterns
Dear R-users, i try to generate missing values in a matrix X according to a given missingnes pattern R with the probabilities p per row. X<-matrix(rnorm(3*100),ncol=3) ## indicator matrix for missingnes (1 observed, 0 missing) R<-matrix(c(1,1,1, 0,0,1, 1,1,0, 0,1,1),ncol=3,byrow=TRUE) ## probabilities for row 1, row 2, row 3 and row 4
2011 Feb 18
3
lm without intercept
...imate Std. Error t value Pr(>|t|) (Intercept) 13.5177 229.0764 0.059 0.9535 N_alt 0.2832 0.1501 1.886 0.0739 . --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Residual standard error: 56.77 on 20 degrees of freedom (16 observations deleted due to missingness) Multiple R-squared: 0.151, Adjusted R-squared: 0.1086 F-statistic: 3.558 on 1 and 20 DF, p-value: 0.07386 The regression is not very good (high p-value, low R-squared). The Pr value for the intercept seems to indicate that it is zero with a very high probability (95.35%). So I repeat the regr...
2008 Apr 07
2
basehaz and newdata
...v(time, status) ~ x + strata(sex), data=test2) #stratified model f1 Call: coxph(formula = Surv(time, status) ~ x + strata(sex), data = test1) coef exp(coef) se(coef) z p x 1.17 3.22 1.29 0.907 0.36 Likelihood ratio test=0.87 on 1 df, p=0.351 n=6 (1 observation deleted due to missingness) > f2 Call: coxph(formula = Surv(time, status) ~ x + strata(sex), data = test2) coef exp(coef) se(coef) z p x 0.896 2.45 1.42 0.63 0.53 Likelihood ratio test=0.38 on 1 df, p=0.535 n=6 (1 observation deleted due to missingness) > > basehaz(f1, newdata=test2) Error in...
2005 Feb 24
1
problem (bug?) with prelim.norm (package norm)
dear list members, there seems to be a problem with the prelim.norm function (package norm) as number of items in the dataset increases. the output of prelim.norm() is a list with different summary statistics, one of them is the missingness indicator matrix "r". it lists all patterns of missing data and a count of how often each pattern occured in the dataset. as the number of items and number of patterns increases, it seems to malfunction, as it stops after less than 200 patterns and the count for the last row/pattern equal...
2001 Feb 11
2
splitting up optional args
Hi, A question (& possible suggestion) about function calls. Is there an R idiom to eliminate the redundancy in the following common situation? foo <- function(x, control=ComplicatedDefault) { etc. } plotfoo <- function(x, foocontrol=ComplicatedDefault, ...) { y <- foo(x, control=foocontrol) lines(x,y,...) } The idea is that there are MANY