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
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 is a computing tool, and each package has implemented algorithms that have history and books and papers that allow those algorithms to be used in a variety if computing environments... from Fortran to Excel to Java to ... R, and probably beyond.>From your description I am going to hazard a guess that perhaps you are considering regression, where the ranges of some variables may be much smaller than others, and yes, among the many types of regression there are many that accept weights... constant values used to scale each "column" of data so that they all have similar ranges. You might be able to get along just fine with the lm function from base R [1], or you might need something more specialized as [2] might discuss. Or you may have something else in mind, but only you can clarify what that might be.It may be wise to do a bit of reading so you know which algorithms you want to apply, and then give us a reproducible, small example of what you have and what you want to get out of this analysis. To do that, you will really need to read and follow the advice in [3]. [1] type "?lm" at the R prompt to get details about that function. If that is too terse, get a text book. [2] https://cran.r-project.org/web/views/Multivariate.html [3] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example --------------------------------------------------------------------------- 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:37:31 PM PDT, Amelia Marsh <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 >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.
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 tocan 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.