Hi Guys,
I am doing some imputation for my dataset. I am looking for code to do
simulation before choosing the right package (mice, Knn). Does anyone have
some code that can do the following:
1. introduce some missing rate into the data
2. Apply the two imputaion methods
3. Compute R
Dear Bert,
I know it is a simple question. But for me, at current, I fail to implement
it. So, I ask for help here.
It is not homework.
Best,
David
2018-07-06 13:32 GMT+08:00 Bert Gunter :
> Is this homework?
>
> (There is an informal no-homework policy on this list).
>
> Cheers,
> Bert
>
>
>
Is this homework?
(There is an informal no-homework policy on this list).
Cheers,
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 )
On Thu, Jul 5, 2018 at 10
Dear All,
I would like to generate N random Bernoulli draws given a probability
function F(x)=1-exp(-2.5*x) in which x follows uniform distribution, say
x~U(0,2).
Can some one leave me some code lines for implementing this?
Thanks in advance.
David
[[alternative HTML version deleted]]
Jim/Rui:
Strictly speaking, this is wrong. What you have described is MCAR --
missing completely at random -- not MAR. They are different! Nevertheless,
the OP seems to be similarly confused about this, so MCAR may in fact be
what what was wanted. Without further context, it is as clear as mud to
Hi Adam,
Looks like you have a matrix or data frame and want to change one or
more observations to NA. I think this will do the trick:
# assume the matrix or data frame is named "ajdat"
randomNA<-function(x,nNA=1) {
dimx<-dim(x)
x[sample(1:dimx[1],nNA),sample(1:dimx[2],nNA)]<-NA
return(x)
}
So
Hello,
What type of data do you have? A vector? Or is it a matrix, a
data.frame, a list, etc?
Suppose it is a vector named x. Then you could do something like
rate <- 0.2
is.na(x) <- sample(length(x), rate*length(x))
At an R prompt type
?is.na
?sample
Hope this helps,
Rui Barradas
Às 21:
Hi,
According to https://cran.r-project.org/web/packages/igraph0/index.html
igraph0 is obsolete.
I don't know what package the gspan() function comes from, but most
likely you should update that package to the current version.
Or, if it's this issue:
https://stackoverflow.com/questions/33268708/
Hi, I’m maryam that ask question about "igraph0" package installation in
R-help. I thank you for your answering. i used and install “igraph” library in
R but i faced with below error when I use this command :
results <- gspan(database)
Error:
Error in library(igraph0) : there is no package ca
Hi,
I want to simulate missing at random for my dataset. Do you know an easy way to
do it?
I want to try not to have the missing�s for the same observations. I mean if
one observation is been selected randomly to have missing I don�t want to have
all the var of the same obs missing.
I want to
Hi Maryam,
Maryam R via R-help writes:
> Hi, i want to install 'igraph0' package in R on windows 10. I downloaded
> "igraph0_0.5.5-1.tar" from Index of /src/contrib/Archive/igraph0 then i try to
> import this package to R with this
> command:install.packages("~/R/igraph0_0.5.5-1.tar.gz",type="so
Hi, i want to install 'igraph0' package in R on windows 10. I downloaded
"igraph0_0.5.5-1.tar" from Index of /src/contrib/Archive/igraph0 then i try to
import this package to R with this
command:install.packages("~/R/igraph0_0.5.5-1.tar.gz",type="source",repos=NULL,
dependencies=TRUE)
|
|
|
12 matches
Mail list logo