Hello Everyone,

I have a query about uncertainty analysis and would really appreciate some
help  in this regard.

I intend to gapfill the NAs in the “X” column of the dataframe (Df1). I
have grouped the data using the column “Group” ,
determined the mean and generated the “Z” column.

While I am using the mean and standard error approach to generate the
uncertainty analysis, can we use the bootstrap approach to
generate the uncertainty for the “Z” column? Any help in this regard will
be really appreciated.

Regards,
Bhaskar
---------------------------------------------------------------

Df1 <-

Group     X            Y    Z
1           2              3     2
1          NA            3     3
1            3             3     3
1           4              3    4
2            2             2    1
2          NA            2    3
2           NA           2    3
2            4             2    4
3             2            2    2
3         NA             2     2
3              2           2     2

-------------------------------------------------------------------------------
Codes:

Df1 <- Df1 %>% group_by(Group) %>% summarise(Y= mean(X), na.rm=T)

Df1  <- Df1%>% mutate(Z= coalesce(X,Y))

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to