[R] Sample Weights

PIKAL Petr petr.pikal at precheza.cz
Mon Jul 27 17:57:50 CEST 2015


Hi

<snip>

> <amelia_marsh08 at yahoo.com> wrote:
> >Dear Sir,
> >
> >I do appreciate your views. Yes even I was also aware about the non
> >clarity in the question. Actaully, I have a large data having lots of
> >data of low magnitude and few of very high magnitude. In order to

can you explain what is low or high magnitude? Or better to use

dput(head(yourdata, 20))

and copy the result so as we might see better what you mean.

Just a guess, from your previous post are you iterested in some summary for your data?

> x<-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)
> table(x)
x
 2  3  4  5  6  7  8
 1  5 11 11 13  6  3

Cheers
Petr


> >analyse the same, some very senior person in the office suggested me
> to
> >assign weights to these obervations.
> >
> >Problem is this senior person is on office tour travelling into
> >Australia and unfortutely I can't even think of reverting to him owing
> >to his seniority. I tried to find through some R libraries if I can
> get
> >something about sample weights.
> >
> >But as you have pointed out, yes my question is too vague and feel
> >really sorry about the same. And I have recently started with R
> >language hence I am trying to learn some basics about R. Thanks for
> >pointing the difference between data.frame and vector.
> >
> >
> >Thanks again for your response.
> >
> >Regards
> >
> >Amelia
> >
> >______________________________________________________________________
> _
> >______________________
> >
> >
> >
> >On Monday, 27 July 2015 11:49 AM, Jeff Newmiller
> ><jdnewmil at dcn.davis.CA.us> wrote:
> >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.
>
> ______________________________________________
> 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.

________________________________
Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. Delete the contents of this e-mail with all attachments and its copies from your system.
If you are not the intended recipient of this e-mail, you are not authorized to use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately accept such offer; The sender of this e-mail (offer) excludes any acceptance of the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into any contracts on behalf of the company except for cases in which he/she is expressly authorized to do so in writing, and such authorization or power of attorney is submitted to the recipient or the person represented by the recipient, or the existence of such authorization is known to the recipient of the person represented by the recipient.


More information about the R-help mailing list