[R] Sample Weights

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Mon Jul 27 08:19:25 CEST 2015


If you have a clear idea what meaning those weights have (?) in the context of a specific calculation (?), and you know what the weights are (?), then it is usually trivially easy to do in R. However,  your question is vague on all of those points, so offering you a solution seems like an invitation for you to mis-use any particular solution offered. Please try to clarify what you are doing that "weights" will help with, and yes, there may just be a weights argument to the function that does that analysis that we can point you to.

You also are unclear what the difference between a data frame and a vector is... if it helps, a data frame is a list of vectors (typically referred to as "columns") all with the same length...  your "mydat" is a vector, not a data frame.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

On July 26, 2015 11:00:54 PM PDT, Amelia Marsh via R-help <r-help at r-project.org> wrote:
>Dear R Forum
>
>I have a data.frame as
>
>
>mydat =
>c(6,6,5,6,4,6,8,4,6,6,6,3,4,6,5,7,7,4,3,5,5,5,3,6,7,4,4,7,4,3,4,6,4,6,5,4,4,7,6,8,5,6,5,5,8,2,3,5,7,5)
>
>Is there any library or way in R to allocate weights to these values?
>Actually I am having a large data, but for illustrative purpose, have
>considered just a small part of the same. 
>
>Regards
>
>Amelia
>
>______________________________________________
>R-help at 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.



More information about the R-help mailing list