Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

egen(stata cmd) compute a summary statistics by groups and store it in to a new variable. For example, the data has three variables, id, time and y, we want to compute the mean of y by for each id and then store it as a new variable mean_y.

In stata, the command would be

egen mean_y = mean(y), by(id)

In R, this task can be completed by `ave`

Generate dataset:

```id <- rep(1:3,each=3)
t<-rep(1:3,3)
y<-sample(1:5,9,replace=T)
my_data<-data.frame(id=id,time=t,y=y)
```

Orignal data:

```> my_data
id time y
1  1    1 4
2  1    2 1
3  1    3 4
4  2    1 2
5  2    2 3
6  2    3 3
7  3    1 4
8  3    2 4
9  3    3 3

> within(my_data, {mean_y = ave(y,id)} )
id time y   mean_y
1  1    1 4 3.000000
2  1    2 1 3.000000
3  1    3 4 3.000000
4  2    1 2 2.666667
5  2    2 3 2.666667
6  2    3 3 2.666667
7  3    1 4 3.666667
8  3    2 4 3.666667
9  3    3 3 3.666667
```

The default summary statistics is `mean`. However, we can assign a particular function to compute the summary statistics. For example, if we want to compute the sd of y by id, then we can have

```within(my_data, {sd_y = ave(y,id,FUN=sd)} )
id time y      sd_y
1  1    1 4 1.7320508
2  1    2 1 1.7320508
3  1    3 4 1.7320508
4  2    1 2 0.5773503
5  2    2 3 0.5773503
6  2    3 3 0.5773503
7  3    1 4 0.5773503
8  3    2 4 0.5773503
9  3    3 3 0.5773503
```

Remark: The `within` evaluate an expression in an environment created from the data.frame. In addition, it will modify the data.frame and return it back(in our case, it create new variables, mean_y or sd_y )

Here is another usage of `ave`. We would like to create a self excluded sample mean by group.

Suppose the data has three variables, id, time and y, we want to compute the mean of y by for each id but excluding the value of y of current time period.

```id <- rep(1:3,each=3)
t<-rep(1:3,3)
y<-sample(1:5,9,replace=T)
my_data<-data.frame(id=id,time=t,y=y)
```

Orignal data:

```> my_data
id time y
1  1    1 4
2  1    2 1
3  1    3 4
4  2    1 2
5  2    2 3
6  2    3 3
7  3    1 4
8  3    2 4
9  3    3 3
```

First, we need a function to compute the self excluded mean. This function takes a vector and a function(default is mean) as argument. It apply the function to the vector where one of the element is removed. The return value is a vector that i-th element is given by FUN(x[-i])

```excludeSelfSummary<-function(x,FUN=mean){
sapply(1:length(x), function(i) FUN(x[-i]))
}
> excludeSelfSummary(1:5,mean)
[1] 3.50 3.25 3.00 2.75 2.50
> excludeSelfSummary(1:5,min)
[1] 2 1 1 1 1
> excludeSelfSummary(1:5,max)
[1] 5 5 5 5 4
```

Then we pass the `excludeSelfSummary into ave as argument. `

``` > within(my_data, {sd_y = ave(y,id,FUN=excludeSelfSummary)} ) id time y sd_y 1 1 1 4 2.5 2 1 2 1 4.0 3 1 3 4 2.5 4 2 1 2 3.0 5 2 2 3 2.5 6 2 3 3 2.5 7 3 1 4 3.5 8 3 2 4 3.5 9 3 3 3 4.0 Of course, we could compute the self excluded minimum or maximum. > within(my_data, {sd_y = ave(y,id,FUN=function(x) excludeSelfSummary(x,min) )}) id time y sd_y 1 1 1 4 1 2 1 2 1 4 3 1 3 4 1 4 2 1 2 3 5 2 2 3 2 6 2 3 3 2 7 3 1 4 3 8 3 2 4 3 9 3 3 3 4 var vglnk = {key: '949efb41171ac6ec1bf7f206d57e90b8'}; (function(d, t) { var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; // s.defer = true; // s.src = '//cdn.viglink.com/api/vglnk.js'; s.src = 'https://www.r-bloggers.com/wp-content/uploads/2020/08/vglnk.js'; var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script')); Related ShareTweet To leave a comment for the author, please follow the link and comment on their blog: R HEAD. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. ```
``` ```
``` ```
``` function init() { var vidDefer = document.getElementsByTagName('iframe'); for (var i=0; i<vidDefer.length; i++) { if(vidDefer[i].getAttribute('data-src')) { vidDefer[i].setAttribute('src',vidDefer[i].getAttribute('data-src')); } } } window.onload = init; R bloggers Facebook page Most viewed posts (weekly) Which data science skills are important (\$50,000 increase in salary in 6-months) Better Sentiment Analysis with sentiment.ai PCA vs Autoencoders for Dimensionality Reduction Self-documenting plots in ggplot2 Dashboards in R Shiny 5 Ways to Subset a Data Frame in R How to write the first for loop in R Sponsors // https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode- // this must be placed higher. Otherwise it doesn't work. // data-cfasync="false" is for making sure cloudflares' rocketcache doesn't interfeare with this // in this case it only works because it was used at the original script in the text widget function createCookie(name,value,days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + value + expires + "; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } // no longer use async because of google // async async function readTextFile(file) { // Helps people browse between pages without the need to keep downloading the same // ads txt page everytime. This way, it allows them to use their browser's cache. var random_number = readCookie("ad_random_number_cookie"); if(random_number == null) { var random_number = Math.floor(Math.random()*100*(new Date().getTime()/10000000000)); createCookie("ad_random_number_cookie",random_number,1) } file += '?t='+random_number; var rawFile = new XMLHttpRequest(); rawFile.onreadystatechange = function () { if(rawFile.readyState === 4) { if(rawFile.status === 200 || rawFile.status == 0) { // var allText = rawFile.responseText; // document.write(allText); document.write(rawFile.responseText); } } } rawFile.open("GET", file, false); rawFile.send(null); } // readTextFile('https://raw.githubusercontent.com/Raynos/file-store/master/temp.txt'); readTextFile("https://www.r-bloggers.com/wp-content/uploads/text-widget_anti-cache.txt"); Recent Posts UPDATE: Successful R-based Test Package Submitted to FDA How to Add Text to a Plot in R How to calculate proportion in a table R Data types 101, or What kind of data do I have? Announcing RStudio Academy Copy ‘plotly’ image to the clipboard Deutschsprachiges Online Shiny Training von eoda How to Calculate a Bootstrap Standard Error in R Dashboards in R Shiny Some R Conferences for 2022 Curating Your Data Science Content on RStudio Connect Adding competing risks in survival data generation measurement units Confidence Intervals Explained The E8 root polytope Jobs for R-usersJunior Data Scientist / Quantitative economistSenior Quantitative AnalystR programmerData Scientist – CGIAR Excellence in Agronomy (Ref No: DDG-R4D/DS/1/CG/EA/06/20)Data Analytics Auditor, Future of Audit Lead @ London or Newcastle python-bloggers.com (python/data-science news)Explaining a Keras _neural_ network predictions with the-tellerObject Oriented Programming in Python – What and Why?Dunn Index for K-Means Clustering EvaluationInstalling Python and Tensorflow with Jupyter Notebook ConfigurationsHow to Get Twitter Data using PythonVisualizations with AltairSpelling Corrector Program in Python Full list of contributing R-bloggers Archives Archives Select Month March 2022  (67) February 2022  (152) January 2022  (155) December 2021  (172) November 2021  (145) October 2021  (199) September 2021  (204) August 2021  (153) July 2021  (172) June 2021  (195) May 2021  (197) April 2021  (183) March 2021  (223) February 2021  (226) January 2021  (252) December 2020  (295) November 2020  (267) October 2020  (276) September 2020  (249) August 2020  (227) July 2020  (268) June 2020  (231) May 2020  (332) April 2020  (326) March 2020  (279) February 2020  (259) January 2020  (250) December 2019  (241) November 2019  (214) October 2019  (230) September 2019  (227) August 2019  (270) July 2019  (258) June 2019  (242) May 2019  (272) April 2019  (289) March 2019  (302) February 2019  (259) January 2019  (282) December 2018  (257) November 2018  (285) October 2018  (298) September 2018  (285) August 2018  (266) July 2018  (327) June 2018  (296) May 2018  (315) April 2018  (296) March 2018  (287) February 2018  (239) January 2018  (328) December 2017  (260) November 2017  (265) October 2017  (287) September 2017  (287) August 2017  (328) July 2017  (279) June 2017  (312) May 2017  (341) April 2017  (319) March 2017  (364) February 2017  (312) January 2017  (364) December 2016  (345) November 2016  (288) October 2016  (298) September 2016  (249) August 2016  (280) July 2016  (322) June 2016  (259) May 2016  (288) April 2016  (258) March 2016  (295) February 2016  (261) January 2016  (334) December 2015  (300) November 2015  (234) October 2015  (255) September 2015  (232) August 2015  (261) July 2015  (240) June 2015  (205) May 2015  (228) April 2015  (203) March 2015  (256) February 2015  (207) January 2015  (237) December 2014  (230) November 2014  (219) October 2014  (212) September 2014  (253) August 2014  (214) July 2014  (226) June 2014  (234) May 2014  (238) April 2014  (256) March 2014  (286) February 2014  (266) January 2014  (260) December 2013  (261) November 2013  (237) October 2013  (233) September 2013  (214) August 2013  (223) July 2013  (254) June 2013  (271) May 2013  (260) April 2013  (278) March 2013  (277) February 2013  (293) January 2013  (340) December 2012  (306) November 2012  (274) October 2012  (304) September 2012  (268) August 2012  (262) July 2012  (247) June 2012  (297) May 2012  (283) April 2012  (295) March 2012  (304) February 2012  (264) January 2012  (278) December 2011  (251) November 2011  (261) October 2011  (280) September 2011  (187) August 2011  (258) July 2011  (219) June 2011  (224) May 2011  (239) April 2011  (267) March 2011  (249) February 2011  (203) January 2011  (209) December 2010  (188) November 2010  (172) October 2010  (219) September 2010  (185) August 2010  (203) July 2010  (175) June 2010  (167) May 2010  (164) April 2010  (152) March 2010  (165) February 2010  (135) January 2010  (121) December 2009  (126) November 2009  (66) October 2009  (87) September 2009  (65) August 2009  (56) July 2009  (64) June 2009  (54) May 2009  (35) April 2009  (38) March 2009  (40) February 2009  (33) January 2009  (42) December 2008  (16) November 2008  (14) October 2008  (10) September 2008  (8) August 2008  (11) July 2008  (7) June 2008  (8) May 2008  (8) April 2008  (4) March 2008  (5) February 2008  (6) January 2008  (10) December 2007  (3) November 2007  (5) October 2007  (9) September 2007  (7) August 2007  (21) July 2007  (9) June 2007  (3) May 2007  (3) April 2007  (1) March 2007  (5) February 2007  (4) November 2006  (1) October 2006  (2) August 2006  (3) July 2006  (1) June 2006  (1) May 2006  (3) April 2006  (1) March 2006  (1) February 2006  (5) January 2006  (1) October 2005  (1) September 2005  (3) May 2005  (1) /* <![CDATA[ */ (function() { var dropdown = document.getElementById( "archives-dropdown-3" ); function onSelectChange() { if ( dropdown.options[ dropdown.selectedIndex ].value !== '' ) { document.location.href = this.options[ this.selectedIndex ].value; } } dropdown.onchange = onSelectChange; })(); /* ]]> */ Other sites Jobs for R-users SAS blogs ```
``` ```
``` Copyright © 2022 | MH Corporate basic by MH Themes ```
``` [{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.r-bloggers.com#Organization","name":"R-bloggers","url":"https:\/\/www.r-bloggers.com","sameAs":[],"logo":{"@type":"ImageObject","url":"http:\/\/www.r-bloggers.com\/wp-content\/uploads\/2021\/05\/R_blogger_logo1_large.png","width":"1285","height":"369"},"contactPoint":{"@type":"ContactPoint","contactType":"technical support","telephone":"","url":"https:\/\/www.r-bloggers.com\/contact-us\/"}},{"@type":"WebSite","@id":"https:\/\/www.r-bloggers.com#website","headline":"R-bloggers","name":"R-bloggers","description":"R news and tutorials contributed by hundreds of R bloggers","url":"https:\/\/www.r-bloggers.com","potentialAction":{"@type":"SearchAction","target":"https:\/\/www.r-bloggers.com\/?s={search_term_string}","query-input":"required name=search_term_string"},"publisher":{"@id":"https:\/\/www.r-bloggers.com#Organization"}},{"@context":"https:\/\/schema.org","@type":"WebPage","@id":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/#webpage","name":"Compute the self excluded sample mean by group","url":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/","lastReviewed":"2013-02-12T00:55:29-06:00","dateCreated":"2013-02-12T00:55:29-06:00","inLanguage":"en-US","description":"egen(stata cmd) compute a summary statistics by groups and store it in to a new variable. For example, the data has three variables, id, time and y, we want to compute the mean of y by for each id and then store it as a new variable mean_y. In stata, the command would be In ","reviewedBy":{"@type":"Organization","name":"R-bloggers","url":"https:\/\/www.r-bloggers.com","logo":{"@type":"ImageObject","url":"http:\/\/www.r-bloggers.com\/wp-content\/uploads\/2021\/05\/R_blogger_logo1_large.png","width":"1285","height":"369"}},"primaryImageOfPage":{"@id":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/#primaryimage"},"mainContentOfPage":[[{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Home","url":"https:\/\/www.r-bloggers.com"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"About","url":"http:\/\/www.r-bloggers.com\/about\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"RSS","url":"https:\/\/feeds.feedburner.com\/RBloggers"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"add your blog!","url":"http:\/\/www.r-bloggers.com\/add-your-blog\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Learn R","url":"https:\/\/www.r-bloggers.com\/2015\/12\/how-to-learn-r-2\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"R jobs","url":"https:\/\/www.r-users.com\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Submit a new job (it's free)","url":"https:\/\/www.r-users.com\/submit-job\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Browse latest jobs (also free)","url":"https:\/\/www.r-users.com\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Contact us","url":"http:\/\/www.r-bloggers.com\/contact-us\/"}]],"isPartOf":{"@id":"https:\/\/www.r-bloggers.com#website"},"breadcrumb":{"@id":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/#breadcrumb"}},{"@type":"BreadcrumbList","@id":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/www.r-bloggers.com","name":"R-bloggers"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/www.r-bloggers.com\/category\/r-bloggers\/","name":"R bloggers"}},{"@type":"ListItem","position":3,"item":{"@id":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/","name":"Compute the self excluded sample mean by group"}}]},{"@type":"Article","@id":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/#Article","url":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/","inLanguage":"en-US","mainEntityOfPage":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/#webpage","headline":"Compute the self excluded sample mean by group","description":"egen(stata cmd) compute a summary statistics by groups and store it in to a new variable. For example, the data has three variables, id, time and y, we want to compute the mean of y by for each id and then store it as a new variable mean_y. In stata, the command would be In ","articleBody":"egen(stata cmd) compute a summary statistics by groups and store it in to a new variable. For example, the data has three variables, id, time and y, we want to compute the mean of y by for each id and then store it as a new variable mean_y. In stata, the command would be egen mean_y mean(y), by(id) In R, this task can be completed by ave Generate dataset: id &lt;- rep(1:3,each3) t&lt;-rep(1:3,3) y&lt;-sample(1:5,9,replaceT) my_data&lt;-data.frame(idid,timet,yy) Orignal data: &gt; my_data id time y 1 1 1 4 2 1 2 1 3 1 3 4 4 2 1 2 5 2 2 3 6 2 3 3 7 3 1 4 8 3 2 4 9 3 3 3 &gt; within(my_data, {mean_y ave(y,id)} ) id time y mean_y 1 1 1 4 3.000000 2 1 2 1 3.000000 3 1 3 4 3.000000 4 2 1 2 2.666667 5 2 2 3 2.666667 6 2 3 3 2.666667 7 3 1 4 3.666667 8 3 2 4 3.666667 9 3 3 3 3.666667 The default summary statistics is mean. However, we can assign a particular function to compute the summary statistics. For example, if we want to compute the sd of y by id, then we can have within(my_data, {sd_y ave(y,id,FUNsd)} ) id time y sd_y 1 1 1 4 1.7320508 2 1 2 1 1.7320508 3 1 3 4 1.7320508 4 2 1 2 0.5773503 5 2 2 3 0.5773503 6 2 3 3 0.5773503 7 3 1 4 0.5773503 8 3 2 4 0.5773503 9 3 3 3 0.5773503 Remark: The within evaluate an expression in an environment created from the data.frame. In addition, it will modify the data.frame and return it back(in our case, it create new variables, mean_y or sd_y ) Here is another usage of ave. We would like to create a self excluded sample mean by group. Suppose the data has three variables, id, time and y, we want to compute the mean of y by for each id but excluding the value of y of current time period. id &lt;- rep(1:3,each3) t&lt;-rep(1:3,3) y&lt;-sample(1:5,9,replaceT) my_data&lt;-data.frame(idid,timet,yy) Orignal data: &gt; my_data id time y 1 1 1 4 2 1 2 1 3 1 3 4 4 2 1 2 5 2 2 3 6 2 3 3 7 3 1 4 8 3 2 4 9 3 3 3 First, we need a function to compute the self excluded mean. This function takes a vector and a function(default is mean) as argument. It apply the function to the vector where one of the element is removed. The return value is a vector that i-th element is given by FUN(x) excludeSelfSummary&lt;-function(x,FUNmean){ \tsapply(1:length(x), function(i) FUN(x)) } &gt; excludeSelfSummary(1:5,mean) 3.50 3.25 3.00 2.75 2.50 &gt; excludeSelfSummary(1:5,min) 2 1 1 1 1 &gt; excludeSelfSummary(1:5,max) 5 5 5 5 4 Then we pass the excludeSelfSummary into ave as argument. &gt; within(my_data, {sd_y ave(y,id,FUNexcludeSelfSummary)} ) id time y sd_y 1 1 1 4 2.5 2 1 2 1 4.0 3 1 3 4 2.5 4 2 1 2 3.0 5 2 2 3 2.5 6 2 3 3 2.5 7 3 1 4 3.5 8 3 2 4 3.5 9 3 3 3 4.0 Of course, we could compute the self excluded minimum or maximum. &gt; within(my_data, {sd_y ave(y,id,FUNfunction(x) excludeSelfSummary(x,min) )}) id time y sd_y 1 1 1 4 1 2 1 2 1 4 3 1 3 4 1 4 2 1 2 3 5 2 2 3 2 6 2 3 3 2 7 3 1 4 3 8 3 2 4 3 9 3 3 3 4","keywords":"","datePublished":"2013-02-12T00:55:29-06:00","dateModified":"2013-02-12T00:55:29-06:00","author":{"@type":"Person","name":"TszKin Julian","description":"","url":"https:\/\/www.r-bloggers.com\/author\/tszkin-julian\/","sameAs":["https:\/\/rlearner.wordpress.com"],"image":{"@type":"ImageObject","url":"https:\/\/secure.gravatar.com\/avatar\/be125c0417c710828b073e830eb7a22c?s=96&d=mm&r=g","height":96,"width":96}},"editor":{"@type":"Person","name":"TszKin Julian","description":"","url":"https:\/\/www.r-bloggers.com\/author\/tszkin-julian\/","sameAs":["https:\/\/rlearner.wordpress.com"],"image":{"@type":"ImageObject","url":"https:\/\/secure.gravatar.com\/avatar\/be125c0417c710828b073e830eb7a22c?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@id":"https:\/\/www.r-bloggers.com#Organization"},"image":[{"@type":"ImageObject","url":"https:\/\/feeds.wordpress.com\/1.0\/comments\/rlearner.wordpress.com\/138\/","width":0,"height":0,"@id":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/#primaryimage"},{"@type":"ImageObject","url":"http:\/\/stats.wordpress.com\/b.gif?host=ctszkin.com&#038;blog=25621776&#038;%23038;post=138&#038;%23038;subd=rlearner&#038;%23038;ref=&#038;%23038;feed=1","width":1,"height":1}],"isPartOf":{"@id":"https:\/\/www.r-bloggers.com\/2013\/02\/compute-the-self-excluded-sample-mean-by-group\/#webpage"}}]}] var snp_f = []; var snp_hostname = new RegExp(location.host); var snp_http = new RegExp("^(http|https)://", "i"); var snp_cookie_prefix = ''; var snp_separate_cookies = false; var snp_ajax_url = 'https://www.r-bloggers.com/wp-admin/admin-ajax.php'; var snp_ajax_nonce = 'c3b5efe1b0'; var snp_ignore_cookies = false; var snp_enable_analytics_events = true; var snp_enable_mobile = false; var snp_use_in_all = false; var snp_excluded_urls = []; Never miss an update! Subscribe to R-bloggers to receive e-mails with the latest R posts. (You will not see this message again.) Click here to close (This popup will not appear again) .snp-pop-109583 .snp-theme6 { max-width: 700px;} .snp-pop-109583 .snp-theme6 h1 {font-size: 17px;} .snp-pop-109583 .snp-theme6 { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field ::-webkit-input-placeholder { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field :-moz-placeholder { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field :-ms-input-placeholder { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field input { border: 1px solid #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field { color: #000000;} .snp-pop-109583 .snp-theme6 { background: #f2f2f2;} jQuery(document).ready(function() { }); var CaptchaCallback = function() { jQuery('.g-recaptcha').each(function(index, el) { grecaptcha.render(el, { 'sitekey' : '' }); }); }; /* <![CDATA[ */!function(e,n){var r={"selectors":{"block":"pre","inline":"code"},"options":{"indent":4,"ampersandCleanup":true,"linehover":true,"rawcodeDbclick":false,"textOverflow":"scroll","linenumbers":false,"theme":"enlighter","language":"r","retainCssClasses":false,"collapse":false,"toolbarOuter":"","toolbarTop":"{BTN_RAW}{BTN_COPY}{BTN_WINDOW}{BTN_WEBSITE}","toolbarBottom":""},"resources":["https:\/\/www.r-bloggers.com\/wp-content\/plugins\/enlighter\/cache\/enlighterjs.min.css?4WJrVky+dDEQ83W","https:\/\/www.r-bloggers.com\/wp-content\/plugins\/enlighter\/resources\/enlighterjs\/enlighterjs.min.js"]},o=document.getElementsByTagName("head")[0],t=n&&(n.error||n.log)||function(){};e.EnlighterJSINIT=function(){!function(e,n){var r=0,l=null;function c(o){l=o,++r==e.length&&(!0,n(l))}e.forEach(function(e){switch(e.match(/\.([a-z]+)(?:[#?].*)?\$/)[1]){case"js":var n=document.createElement("script");n.onload=function(){c(null)},n.onerror=c,n.src=e,n.async=!0,o.appendChild(n);break;case"css":var r=document.createElement("link");r.onload=function(){c(null)},r.onerror=c,r.rel="stylesheet",r.type="text/css",r.href=e,r.media="all",o.appendChild(r);break;default:t("Error: invalid file extension",e)}})}(r.resources,function(e){e?t("Error: failed to dynamically load EnlighterJS resources!",e):"undefined"!=typeof EnlighterJS?EnlighterJS.init(r.selectors.block,r.selectors.inline,r.options):t("Error: EnlighterJS resources not loaded yet!")})},(document.querySelector(r.selectors.block)||document.querySelector(r.selectors.inline))&&e.EnlighterJSINIT()}(window,console); /* ]]> */ window.FPConfig= { delay: 0, ignoreKeywords: ["\/wp-admin","\/wp-login.php","\/cart","add-to-cart","logout","#","?",".png",".jpeg",".jpg",".gif",".svg"], maxRPS: 3, hoverDelay: 50 }; _stq = window._stq || []; _stq.push([ 'view', {v:'ext',j:'1:7.3.3',blog:'11524731',post:'64962',tz:'-6',srv:'www.r-bloggers.com'} ]); _stq.push([ 'clickTrackerInit', '11524731', '64962' ]); jQuery(document).ready(function (\$) { for (let i = 0; i < document.forms.length; ++i) { let form = document.forms[i]; if (\$(form).attr("method") != "get") { \$(form).append('<input type="hidden" name="bIDiEKaSr" value="[NwX]avgpyM" />'); } if (\$(form).attr("method") != "get") { \$(form).append('<input type="hidden" name="JtlBfjh" value="JlitU.M3" />'); } if (\$(form).attr("method") != "get") { \$(form).append('<input type="hidden" name="BNXYvMTtg" value="m6Py@WO3Y0u" />'); } } \$(document).on('submit', 'form', function () { if (\$(this).attr("method") != "get") { \$(this).append('<input type="hidden" name="bIDiEKaSr" value="[NwX]avgpyM" />'); } if (\$(this).attr("method") != "get") { \$(this).append('<input type="hidden" name="JtlBfjh" value="JlitU.M3" />'); } if (\$(this).attr("method") != "get") { \$(this).append('<input type="hidden" name="BNXYvMTtg" value="m6Py@WO3Y0u" />'); } return true; }); jQuery.ajaxSetup({ beforeSend: function (e, data) { if (data.type !== 'POST') return; if (typeof data.data === 'object' && data.data !== null) { data.data.append("bIDiEKaSr", "[NwX]avgpyM"); data.data.append("JtlBfjh", "JlitU.M3"); data.data.append("BNXYvMTtg", "m6Py@WO3Y0u"); } else { data.data = data.data + '&bIDiEKaSr=[NwX]avgpyM&JtlBfjh=JlitU.M3&BNXYvMTtg=m6Py@WO3Y0u'; } } }); }); ```