text: Next, Stata’s pscore command was used to generate the propensity score using a logit model fitted using covariates associated with the receipt of at least four ANC visits (referred to as Appropriate ANC) and both outcomes (Table 1). Logistic regression analysis was then used to explore the impact of public–private differences in the use of assisted reproductive technologies, plurality, major congenital anomalies, birth method, and gestational age. An estimate of the propensity score is not enough to estimate the ATT of interest using (2). There is a catch though – the propensity score must be estimated. You don't have to rely on the notion of an underlying y*, and some prefer not to. An extension of the logistic model to sets of interdependent variables is the conditional random field. It is essential that a ﬂexible functional form be used to allow for possible nonlinearities in the participation model. 25 Imbalance of the distribution of baseline attributes between groups was measured by standardised difference, the. I What is the exact formula?. For instance, if the variance of the logit of the propensity score in the treated subjects is the same as the variance in the untreated subjects, using calipers of width equal to 0. The propensity score Think of the propensity score as a one-number summary of all covariates. Creating propensity score weights • Same creation of propensity scores as for matching • P(Z)=Pr(Ti=1 | Zi) where Z is a vector of pre-exposure characteristics • Predict probabilities of participation using logit or probit: • Use propensity scores to create weights • Weights (wi) are the inverse of the probability of receiving the. −Find E- subject with closest propensity score, −Repeat until all E+ subjects are matched. propensity scores. This suggestion incorporates the fact that differences in probabilities of a fixed size are more important when the probabilities are close to 0 or 1. Rosenbaum and Rubin (1985) suggest that the logit of the propensity score is better to use for matching than the propensity score itself. All Social Sciences Research Methods Programme courses Show: Instructor led Self-taught and online. Including the propensity score in a logistic regression model for the outcome means the interpretation of the treatment effect is the odds ratio conditional on the propensity score (i. Logistic regression analysis was then used to explore the impact of public–private differences in the use of assisted reproductive technologies, plurality, major congenital anomalies, birth method, and gestational age. A logit score propensity matching method was used to estimate the average treatment effect, which represents the average difference in “mine year” injury rate between partner mines and matched comparison mines, by mine hours, number of miners, production (coal mines only), number of years in operation, and year of operation. , the propensity score The propensity score is a way of summarizing the information in all the prognostic variables. Propensity score matching (PSM) is a quasi-experimental method in which the researcher uses statistical techniques to construct an artificial control group by matching each treated unit with a non-treated unit of similar characteristics. The model includes several sets of dummy variables. Table 1: Pre- and Post-PSM by Age, Charlson Score, and Gender Pseudo-Randomization In Retrospective Analysis Using The Generalized Multinomial Logit For Propensity Score Generation SM Wilson; T Mayne DaVita Inc. Propensity scores created using PROC LOGISTIC or PROC GENMOD – The propensity score is the conditional probability of each patient receiving a particular treatment based on pre-treatment variables – Creates data set with predicted probabilities as a variable – Or use logit of p score log (1/1-p) 1 1 ( ) e iXi P Y + − α+Σβ =. Estimating the propensity score in STATA with logistic regression. As recommended in earlier literature, 20 we matched on the logit of the propensity score and used a matching caliper of 0. Kelcey A dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy (Education) in The University of Michigan 2009 Doctoral Committee: Professor Kenneth Frank, Co-Chair. We matched subjects on the logit of the propensity score,19 using calipers of width equal to 0. 2 of the standard deviation of the logit of the propensity score. 2, this means 0. SAS EG View of Final Logit Propensity Scores "psc" Adequacy of Created Propensity Scores A well‐fitted model may not necessarily produce good enough p‐scores to balance the distributions of covariates over the conditions (Shadish, Luellen, & Clark; 2006). The propensity score was estimated by a logistic regression model. econometricsacademy 172,288 views. mimetypeMETA-INF/container. PS typically are computed by using a logistic regression (LR) [3]. We might not have a sufficient theoretical or empirical basis to specify the propensity score estimation. Rosenbaum and Rubin (1985) suggest that the logit of the propensity score is better to use for matching than the propensity score itself. R Tutorial 8: Propensity Score Matching - Simon Ejdemyr. While it is commonly used in experimental studies, the propensity score method can also be effective in performing empirical analyses in other domains. propensity score, logit of propensity score (LPS), IPTW, SIPTW, and SMRW. % Estimating treatment effects via propensity score Xr will automatically inherit all variable names from X # run logit, get fitted PS scores logit. 51244 Ordered logit estimates Number of obs = 400 LR chi2(3) = 24. The Penalized Maximum Likelihood Estimation (PMLE) was used to create the propensity scores. プロペンシティスコア（Propensity score; PS）（1）－PSの正しい使い方 投稿者: 津川 友介 投稿日: 2015/05/04 2019/04/24 今回は疑似実験（Quasi-experiment）の中でも近年ますます使われるようになってきているプロペンシティスコア（Propensity score; 以下PS）を用いた解析. Another example, which will be discussed in this post is treatment effects by matching. Alternatively, indepvars need to be specified to allow the program to estimate the propensity score on them. Easiest with regard to programming is: regression adjustment with the propensity score. using the logit of the estimated propensity score for matching because the distribution of transformed scores is often approximately normal. The common support region is defined as the largest interval that contains propensity scores for subjects in both groups. Comparisons were made using standardised differences, with differences of 10% or greater considered to be meaningful. HAIYAN BAI [continued]: can meet most of the basic statistical analysis assumptions. The good news is, they are conservative, as shown more generally in Wooldridge (2007, Journal of Econometrics), "Inverse Probability Weighted M-Estimation for General Missing Data Problems. 2 times the SD of the logit of the propensity score. 3) Form 5 (or more) relatively homogeneous subgroups of patients with similar estimated propensity scores by dividing. Ordinary logistic regression was executed with all 40 covariates entered as predictors in order to create the propensity score. THE USE OF NONPARAMETRIC PROPENSITY SCORE ESTIMATION WITH DATA OBTAINED USING A COMPLEX SAMPLING DESIGN Ji An & Laura M. This article describes the gologit2 program for generalized ordered logit models. Propensity score matching using psmatch2 by Stata Stata Stata13からははteffectsという公式のコマンドで傾向スコア分析ができるようになっていますが、それ以前はユーザー提供のadoファイルによって実行するのが普通でした。. Compared to the older style propensity matching to create a pseudo control sample, it may be better to weight the full data by inverse propensity score because it doesn't discard data. The propensity score was estimated by a logistic regression model. 2 of the SD of the logit of the propensity score to ensure sufficient balance in collected variables between matching pairs. So the logit of the propensity score is unbounded so it could take a value anywhere on the real line. PSM: Key Assumptions Key assumption: participation is independent of outcomes conditional on Xi This is false if there are unobserved outcomes affecting participation Enables matching not just at the mean but balances the distribution of observed characteristics across treatment and control Density 0 1 Propensity score Region of common support. 2 * the std deviation of the linear propensity score (logit of propensity score) performs well as a caliper width Matching Techniques o Greedy matching o Nearest neighbor o Optimal matching Austin 2013. Ordered Logit Models - Basic & Intermediate Topics Page 4 NOTE: As Long points out, you can also motivate the ordered logit model by thinking of it as a nonlinear probability model, i. propensity score matching as an analytic strategy, which created counterfactual groups that were as similar as possible to facilitate comparison between the treated and controlled subjects. propensity score's distribution can be obtained by splitting the sample by quintiles of the propensity score. ca or joseph. The central role of the propensity score in observational studies for causal effects BY PAUL R. Practical Lessons using Propensity Scores to Generate Comparison Groups for Persistence Research Jennifer Lowman, Ph. Reweighting tries to leverage that information. With the large amount of information. same period. Elizabeth Stuart (JHSPH) Propensity scores May 31, 2011 10 / 216 The units The entities to which we could apply or withhold the treatment e. PS typically are computed by using a logistic regression (LR) [3]. Using greedy matching, we matched the treatment group 1:1 to control patients using a caliper width. calipers of width equal to 0. analysis, with different scores and their confidence intervals for continuous variables. propensity score on them. プロペンシティスコア（Propensity score; PS）（1）－PSの正しい使い方 投稿者: 津川 友介 投稿日: 2015/05/04 2019/04/24 今回は疑似実験（Quasi-experiment）の中でも近年ますます使われるようになってきているプロペンシティスコア（Propensity score; 以下PS）を用いた解析. Practices aims to ensure that coffee is produced from sustainable farming and process by evaluating…. Practitioners usually estimate a logit or probit to predict treatment assignation and then check the covariate balance given by the resulting propensity score. Propensity Score Rosenbaum and Rubin (1983) realized the bias from covariates can be eliminated by controlling for a scalar-valued function (a "balancing score") calculated from the baseline covariates, i. The propensity score is the conditional probability that any census tract is designated as an Enterprise Zone, given the observed characteristics of the tract in 1990 [12]. We perform the simulation to assess the performance of this new method and covariates adjusted Cox model and score test. Inverse Propensity Score Weighting (IPSW) Until now we discussed matching on the P-score, a di erent approach is to re-weight the observations by the P-score By weighting the observations according to the true P-score, we can make the treated and control observation have exactly the same distribution of covariate, F XjT=1(x) = F XjT=0(x) where. The other day I needed to conduct propensity score matching, but I was working with geographic data and wanted to restrict the matches to within a certain geographic distance. As our reweighting estimator for $\psi$ is constructed on the basis of consistent propensity score estimation (rather than the balancing property), it is not surprising to see the poor performance of EB. A GME discrete choice model is used to develop propensity scores and estimate treatment effects in a set of Monte Carlo simulations. 20 of the standard deviation of the logit of the propensity score. econometricsacademy 172,288 views. 6 of the standard deviation of the logit of the propensity score; matching on the propensity score using calipers of 0. When the treatment and control groups are not equal on the dependent variable initially, the. Application of Propensity Score Matching in Observational Studies Using SAS Yinghui (Delian) Duan, M. propensity score can be used to control for confounding in the estimation of average cost‐effectiveness, and provide syntax codes for both propensity score matching and cost‐effectiveness modelling. An example from Fair Trade certification of coffee producers (AE 2016). Form some number of buckets, say 10 buckets in total (one bucket covers users with a 0. 2 of the standard deviation of the logit of the propensity score, as. 2 of the standard deviation of the logit of the propensity score (referred to as full with caliper). 0319 chron ill 0. PSM: Key Assumptions Key assumption: participation is independent of outcomes conditional on Xi This is false if there are unobserved outcomes affecting participation Enables matching not just at the mean but balances the distribution of observed characteristics across treatment and control Density 0 1 Propensity score Region of common support. For these analyses, patients were matched on the logit of the propensity score using a caliper of 0. Mixed logit is an extension of multinomial logit that allows for correlations among the choices of the dependent variable. 20 means allowing for a difference of. In all Cox regressions, the robust. The table of propensity scores gives the calculated propensity score for each participant of the two groups. Idea: in a randomized study, treatment assignment Z and covariates X are independent. You can extract the propensity scores for the whole sample from the matchit object. Propensity Score Matching and Quasi-experimental methods: , Propensity Score Matching and , Difference in Differences CIE Training 10/67 Propensity Score. So this is a very simple question, just can't seem to figure it out. An alternative method of controlling for observed variables is propensity score matching. Version info: Code for this page was tested in Stata 12. The two seemingly identical commands yield very different treatment effect estimates. Fully updated to reflect the most recent changes in the field, the Second Edition of Propensity Score Analysis provides an accessible, systematic review of the origins, history, and statistical foundations of propensity score analysis, illustrating how it can be used for solving evaluation and causal-inference problems. This post was written jointly with David Drukker, Director of Econometrics, StataCorp. The DISTANCE=LPS option (which is the default) requests that the logit of the propensity score be used in computing differences between pairs of observations. For these analyses, patients were matched on the logit of the propensity score using a caliper of 0. The covariates in the logit regression consist of important pre-treatment. propensity score to reduce the dimensionality problem. Demonstration Code for Propensity Scores in Clinical Research. This feature is not available right now. Principal Findings: Compared to nonparticipants, participants were more likely to have vaccinations for -. 682175 > ipwe0 [1] 0. 2 of the standard deviation of the logit of the propensity score. Propensity scores can only control for observed confounders; that is, the propensity score cannot be counted upon to balance unobserved covariates Propensity scores themselves are, almost without exception in the published literature, created using maximum likelihood logistic regression models [ 4 , 5 ], despite relatively early suggestions of. Some observations were automatically dropped because some dummy variables perfectly predict failures, i. Propensity score analysis is intended to avoid problems associated with the misspecification of covariate adjusted models of outcomes, but the quality of the balance and the treatment effect estimates can be sensitive to the method used to estimate the propensity scores. An Example of Propensity Score-Matched Analysis using Simulated Data: Practical Walkthrough with SAS Code Joseph M. Tuesday, March 22, 2011 How to use the method of "propensity scores analysis" in SPSS?. propensity score, logit of propensity score (LPS), IPTW, SIPTW, and SMRW. The output below indicates that the propensity score matching creates balance among covariates/controls as if we were explicitly trying to match on the controls themselves. is a straightforward extension of the propensity score theory of Rosenbaum and Rubin (1983) incorporated into survey nonresponse problems by David et al. Second, we used greedy nearest neighbour caliper matching. But it still preserves the ranks of the propensity score itself. The model's probabilistic estimate that a user will start drinking Soylent is called a propensity score. Performing a regression (rather than simple cross tabs) after the weighting or matching is a good idea to handle inevitable imperfections. However, Stata 13 introduced a new teffects command for estimating treatments effects in a variety of ways, including propensity score matching. The propensity score can also be obtained by (i) running a logit model of the treatment variable, and then (ii) obtaining the predicted probabilities. Logistic Regression (Logit Model): a Brief Overview Probability and Statistics > Regression Analysis > Logistic Regression / Logit Model In order to understand logistic regression (also called the logit model), you may find it helpful to review these topics:. If it is not equivalent, one or. −Easiest method in terms of computational considerations. Ordered logistic regression (or ordered logit) handles ordinal dependent variables (ordered values). Exploring the Use of the Propensity Score to Control for Merger Probability Bronwyn H. 2 times the standard deviation of the logit of the propensity score. To convert a logit (glm output) to probability, follow these 3 steps: Take glm output coefficient (logit). Assuming that y is the outcome and T is the treatment indicator, Kaplan and Chen. Type "findit nichols" in Stata to see some Stata programs written by me. If treated and a control units have the same propensity score, then they have the same distribution of all the covariates that were used to estimate the propensity score. Previous theoretical arguments have. One problem is that the standard errors from the second logit will not be correct because they ignore the estimation of the propensity score. It started out asking about calculation of sample size, but has morphed into a discussion of analysis methods, and I think two of the recent posts (by Steve Simon and Mark Schwartz) present an approach that may be useful (using the logit of the propensity score as a covariate). , treatment vs. o Count how many controls have a propensity score lower than the minimum or higher than the maximum of the propensity scores of the treated o and vice versa. The idea behind propensity score matching is that by giving each individual in the study a propensity score, we can compare individuals in different treatment groups and try to make the individuals as equivalent as possible so that we can control the confounding factors, the different result would be from the treatment only. Kalbﬂeisch Department of Biostatistics, University of Michigan. So the logit of the propensity score is unbounded so it could take a value anywhere on the real line. On the basis of the logit of estimated propensity scores, we created a matched subsample: Fifteen hundred randomly selected non-kin children were matched to 1,500 kin children. Besides factor score matching and Mahalanobis distance matching, we examined two types of propensity score matching on: “naïve” propensity score derived from manifest covariates, and “true” propensity score derived from latent factor. 2 times the standard deviation of the logit of the propensity score. Exploring the Use of the Propensity Score to Control for Merger Probability Bronwyn H. The effect was evaluated via cumulative logit regression including propensity scores as a covariate. , the propensity score The propensity score is a way of summarizing the information in all the prognostic variables. Researchers first estimate a propensity score for each student (or other unit) in the sample (Rosenbaum and Rubin, 1983). The higher the score, the more likely one is assigned (or chose) the NEW treatment. Once a propensity-score-matched sample had been formed, we estimated the effect of treatment on survival using three different methods. nonusers based on the propensity score, using a caliper width equal to 0. Previous theoretical arguments have. Propensity score analysis is intended to avoid problems associated with the misspecification of covariate adjusted models of outcomes, but the quality of the balance and the treatment effect estimates can be sensitive to the method used to estimate the propensity scores. 2 SD of the logit of the propensity score. ROSENBAUM Departments of Statistics and Human Oncology, University of Wisconsin, Madison, Wisconsin, U. One or more controls are matched to each case on this propensity score as. 1 / 48 Propensity Scoring matching in Cluster Randomized Trials Zhenzhen Xu Abbott Laboratories, Chicago IL Joint work with John D. propensity score, logit of propensity score (LPS), IPTW, SIPTW, and SMRW. 24,25 For longitudinal analysis of the primary outcome of interest, only participants who had accrued follow-up time and had nonmissing exacerbation data were eligible to be matched. Reweighting tries to leverage that information. propensity score is created from a logit or probit modal as the predicted probability that a subject received treatment given a set of baseline characteristics. The treatment effect was estimated using a linear mixed-effects model with a ran-dom intercept for each matching pair. CHPR PCOR Brown Bag Seminar. Third, we note that the covariate balancing property follows directly from the deﬁnition of the propensity score and does not require the ignorability assumption that is given in equation (2). I In for a penny, in for a pound?The justi cation for matching on the propensity score, rather than on covariates, was that you believe your propensity score model. If two subjects, one who is a smoker and the other who is not, have similar propensity scores, then we think of them as potential matches. 2017 & Stuart et al. 2 standard deviations of the logit of the propensity score [20 x [20] Austin, P. An output data set of each patient's propensity score can be generated with SAS using PROC LOGISTIC, and a generalized SAS macro can do optimized N:1 propensity score matching of patients assigned to different groups. Exploring the Use of the Propensity Score to Control for Merger Probability Bronwyn H. So you could match on logit to the propensity score rather then the propensity score. The propensity score is the estimated probability of receiving treatment (ie, being a smoker), conditional on the covariates. Practices Certification Toward Lintong Coffee Farming In North Sumatra. Advantages of Propensity Score Matching. The broadly used logit model for the propensity score is a multistep approach: (1) selecting the powerful covariates that distinguished the treatment and control groups the most; (2) including the selected covariates and their interaction and/or quadratic terms in a one-equation logit model to estimate the propensity score using maximum. Mixed logit is an extension of multinomial logit that allows for correlations among the choices of the dependent variable. With the large amount of information. Frequency of propensity scores is the same for treated and control. One popular method is propensity-score matching, despite there has been no evidence showing PS matching is better than “traditional” regression adjustment method (see Elze et al. Propensity Score Analysis with Hierarchical Data Fan Li Alan Zaslavsky Mary Beth Landrum Department of Health Care Policy Harvard Medical School May 19, 2008. Computing propensity score The propensity score is unknown and must be estimated. ROSENBAUM Departments of Statistics and Human Oncology, University of Wisconsin, Madison, Wisconsin, U. These models are appropriate when the response takes one of only two possible values representing success and failure, or more generally the presence or absence of an attribute of interest. STATA> findit psmatch2 // Sort individuals randomly before matching // Set random seed prior to psmatch2 to ensure replication. 7 A propensity score for each subject in the study is then found by. Survival was compared using mean values restricted to a maximum of 365 days [11]. it Department of Statistics, Computer Science, Applications University of Florence TATE Talks, UNC, School of Social Work May 22, 2017. Mild traumatic brain injury (mTBI) has been widely studied and the effects of injury can be long term or even lifelong. The following are code examples for showing how to use statsmodels. Propensity Score Matching in Stata using teffects For many years, the standard tool for propensity score matching in Stata has been the psmatch2 command, written by Edwin Leuven and Barbara Sianesi. Range 0-1; higher = greater likelihood to participate in dual enrollment. ﬁed into deciles by propensity score using the Subclassiﬁcation routine of MatchIt. Learn several Econometrics Models including the most popular ones - Panel Data Models, Probit and Logit Models, Time Series ARIMA Models, Propensity Score Matching, Instrumental Variables, and many more. −Nearest available Mahalanobis metric matching w/ propensity score-based calipers. STATA> logistic treat x1 x2 x3 x4 x5. Propensity score matching attempts to select a sample from a pool of treatment and control units, such that the two groups are similar on a set of key matching variables. 313326, and 0. The common support region is defined as the largest interval that contains propensity scores for subjects in both groups. Model to be used for the estimation 2. Nicole Danna : If your outcome is y, your "treatment" is x and other RHS variables all start with v, then you can calculate a propensity score with logit x v* predict p Then you want to make sure that p does not have positive density near zero or one, e. The first part of this thesis deals with problems of the analytic supports of the logit propensity score and various matching methods. Stata does not have a built-in command for propensity score matching, a non-experimental method of sampling that produces a control group whose distribution of covariates is similar to that of the treated group. 313326, and 0. the maximum distance between the estimated propensity scores of treated and untreated observations to be matched is generally defined as x=0. Calculating Propensity Scores 3. The propensity score is the probability of treatment or exposure status conditional on observed patient characteristics. 02 of the standard. The procedure either computes propensity scores or reads previously-computed propensity scores, and it provides the following methods for using the scores to allow for valid estimation of treatment effect in a subsequent outcome analysis:. If, conditional on the propensity score being balanced, the covariates are unbalanced, the specification of the propensity score is not adequate and has to be re-specified, e. 3) Form 5 (or more) relatively homogeneous subgroups of patients with similar estimated propensity scores by dividing. gologit2 is inspired by Vincent Fu’s gologit routine (Stata Technical Bulletin Reprints 8: 160–164) and is backward compatible with it but offers several additional powerful options. I In for a penny, in for a pound?The justi cation for matching on the propensity score, rather than on covariates, was that you believe your propensity score model. The concept of Propensity score matching (PSM) was first introduced by Rosenbaum and Rubin (1983) in a paper entitled "The Central Role of the Propensity Score in Observational Studies for Casual Effects. Example 1: A marketing research firm wants to investigate what factors influence the size of soda (small, medium, large or extra large) that people order at a fast-food chain. Reducing Bias in Observational Studies Using Subclassification on the Propensity Score Created Date: 20160809013516Z. o Count how many controls have a propensity score lower than the minimum or higher than the maximum of the propensity scores of the treated o and vice versa. of (logit) propensity score to choose new whitner * = STD whitener = NEW whitener tx 0 1 predi ct ed gray scal e 10 20 30 40 50 60 70 80 propen score f or new-2 -1 0 1 2 As the propensity to choose the NEW treatment increases, the mean difference between the two treatments increases. , Denver, CO, USA Introduction Results. Please try again later. 7 A propensity score for each subject in the study is then found by. Type "findit nichols" in Stata to see some Stata programs written by me. The use of propensity scores in the social. The quality of matching was assessed by com-. On the other hand, comparison cases with features typical of the treatment cases would receive larger weights. (2014), the standard deviation is 1. , non-equivalent control group or case-control group design). 20 of the standard deviation of the logit of the propensity score. A GME discrete choice model is used to develop propensity scores and estimate treatment effects in a set of Monte Carlo simulations. For example, the following commands compute propensity scores similar to the propensity scores obtained from the psmatch2 command in the example above: */ Runs the logit model. propensity scores. seed(08544). Fully updated to reflect the most recent changes in the field, the Second Edition of Propensity Score Analysis provides an accessible, systematic review of the origins, history, and statistical foundations of propensity score analysis, illustrating how it can be used for solving evaluation and causal-inference problems. Propensity‐score matching is increasingly being used to estimate the effects of exposures using observational data. R Tutorial 8: Propensity Score Matching - Simon Ejdemyr. A Practical Guide to Getting Started with Propensity Scores. The concept of Propensity score matching (PSM) was first introduced by Rosenbaum and Rubin (1983) in a paper entitled "The Central Role of the Propensity Score in Observational Studies for Casual Effects. We perform the simulation to assess the performance of this new method and covariates adjusted Cox model and score test. Note that the last four covariate adjustment options have not been found previous studies. 2 Propensity Score Methods and the Collapsibility Problem for the Logit Model, 313 13. 05 times the standard deviation of the logit of the propensity score. However, the quality of the matches can be affected by decisions made during the matching process, particularly the order in which subjects are selected for matching and the maximum permitted difference between matched subjects (the “caliper”). Range 0-1; higher = greater likelihood to participate in dual enrollment. odds match on the logarithm of the odds ratio of the propensity score (stored in _pscore). index use the latent variable index instead of the probability. So you could match on logit to the propensity score rather then the propensity score. Standardized. By default, the region is extended by 0. Therefore, it is feasibile to use a propensity score match-ing method to minimize the bias on estimating measure of association between H1N1 (2009) pandemic. プロペンシティスコア（Propensity score; PS）（1）－PSの正しい使い方 投稿者: 津川 友介 投稿日: 2015/05/04 2019/04/24 今回は疑似実験（Quasi-experiment）の中でも近年ますます使われるようになってきているプロペンシティスコア（Propensity score; 以下PS）を用いた解析. With a propensity score calculated for each sample unit, the propensity score from the logistic regression is used in two different ways: 1. Practical Lessons using Propensity Scores to Generate Comparison Groups for Persistence Research Jennifer Lowman, Ph. PSM: Key Assumptions Key assumption: participation is independent of outcomes conditional on Xi This is false if there are unobserved outcomes affecting participation Enables matching not just at the mean but balances the distribution of observed characteristics across treatment and control Density 0 1 Propensity score Region of common support. 1% for high risk. 8 Step 1: select variables. For the propensity score matching, a caliper width of 0. full matching for the vector of Mahalanobis’ distances and propensity scores to estimate the difference between participants and non-participants in the probability of a range of asthma outcomes. 313326, and 0. A GME discrete choice model is used to develop propensity scores and estimate treatment effects in a set of Monte Carlo simulations. How can I determine the caliper in a propensity score matching? the logit of the propensity score is the optimal caliper To realize propensity score matching in PS Matching module of SPSS. The other day I needed to conduct propensity score matching, but I was working with geographic data and wanted to restrict the matches to within a certain geographic distance. In the propensity score, the bias decreased as the strength of the association of the exposure with the outcome increased. 1 Using the U. 20 in the overall propensity score. 3 Implementation of Propensity Score Matching 3. Examples include estimating the effects of a training program on job performance or the effects of a government program targeted at helping particular schools. STATA> logistic treat x1 x2 x3 x4 x5. Exploring the Use of the Propensity Score to Control for Merger Probability Bronwyn H. Stata does not have a built-in command for propensity score matching, a non-experimental method of sampling that produces a control group whose distribution of covariates is similar to that of the treated group. These include the propensity score matching (PSM), stratification (or sub-classification) on the propensity score, inverse probability of treatment weighting (IPTW) by using the propensity score, and covariate adjustment by using the propensity score [1]. The distance between the two participants in term of logit of the propensity score is also given. The propensity score is the conditional probability that any census tract is designated as an Enterprise Zone, given the observed characteristics of the tract in 1990 [12]. Propensity-score-matched subgroup analysis was performed both as sensitivity analysis and to corroborate the results from adjusted analyses of the impact of adrenaline on mortality. The propensity score is assumed to take a logit form with an index that is linear in the function of always observed variables h_X. The Penalized Maximum Likelihood Estimation (PMLE) was used to create the propensity scores. Propensity scores and weighting. 2 of the standard deviation of the logit of the propensity score (referred to as full with caliper). In seminal work, Rosenbaum and Rubin (1983) proposed propensity score matching as a method to reduce the bias in the estimation of. I am not good at macros. Propensity Score Matching and Related Models Examples in Stata Greedy matching and subsequent analysis of hazard rates Optimal matching Post-full matching analysis using the Hodges-Lehmann aligned rank test Post-pair matching analysis using regression of difference scores Propensity score weighting. ROSENBAUM Departments of Statistics and Human Oncology, University of Wisconsin, Madison, Wisconsin, U. , Denver, CO, USA Introduction Results. Furthermore, neither the weighting method nor the covariate adjustment method has been applied, evaluated, or explored in road safety studies. propensity score, logit of propensity score (LPS), IPTW, SIPTW, and SMRW. CHPR PCOR Brown Bag Seminar. The Penalized Maximum Likelihood Estimation (PMLE) was used to create the propensity scores. In the PSM with multi-valued treatments approach, we follow Lechner [33] by estimating separate conditional probabilities between participants of a single or a combination of campaign platforms and non-participants to obtain propensity scores using logit regressions. Examples of ordered logistic regression. • Five subclasses are expected to remove 90% of bias from modeled covariates. ROSENBAUM and DONALD B. 4 The Problem of Zero-Sample Estimates of Conditional Probabilities and the Use of Semiparametric Models to Solve the Problem, 318. When some values of the covariates are missing, analysts can use multiple imputation to ll in the missing data, estimate propensity scores based on the m com-pleted datasets, and use the propensity scores to estimate treatment e ects. Logit and probit models with the binary treatment indicator as the dependent variable are commonly used. , by logistic regression. STATA> logistic treat x1 x2 x3 x4 x5. 2 times the standard deviation of the logit of the propensity score, calculated as , where the σ 2 values were the variance of the logit of the propensity score observed among patients in each cohort's two treatment. econometricsacademy 172,288 views. Weak Instruments (2006 Slides) Causal Inference (2007 Slides) Cluster-robust SEs (2007 Slides) GMM (2008 Slides) Causal inference with observational data Stata Journal 7(4): 507-541. The Journal of Econometrics serves as an outlet for important, high quality, new research in both theoretical and applied econometrics. β represent, respectively, the adjusted mean outcome in the control group, the adjusted mean differential outcome, and the change in mean outcome associated with a marginal change in the propensity score. Principal Findings: Compared to nonparticipants, participants were more likely to have vaccinations for -. This is the value that is used to compute the distance between each participant. In order for the propensity scores to correctly estimate the probability of. However, there are significant differences in the effectiveness of selection bias reduction among the existing PSM methods and, therefore, it is challenging for researchers to select. That propensity score is the probability of being assigned to the treatment group. Third, we note that the covariate balancing property follows directly from the deﬁnition of the propensity score and does not require the ignorability assumption that is given in equation (2). Conversion rule. In seminal work, Rosenbaum and Rubin (1983) proposed propensity score matching as a method to reduce the bias in the estimation of. Twitter may be over capacity or experiencing a momentary. Propensity-score-matched subgroup analysis was performed both as sensitivity analysis and to corroborate the results from adjusted analyses of the impact of adrenaline on mortality. Kalbﬂeisch Department of Biostatistics, University of Michigan. The score estimate was converted into a logit scale for propensity score adjustment analyses. Or where to put the commands to use the macro. • Researchers often report the marginal effect, which is the change in y* for each unit change in x. 2 * the std deviation of the linear propensity score (logit of propensity score) performs well as a caliper width Matching Techniques o Greedy matching o Nearest neighbor o Optimal matching Austin 2013. Calculating Propensity Scores 3. 20 in the overall propensity score. This is a sub-function of the matchit command, which calculates the distance measure used in the matching, usually the propensity score. Data analysis Sample mean variance IQR range Outliers Boxplot Expected value. Propensity score matching is currently the most popular version of this approach and is based on balancing covariates through matching conducted on a propensity score (Rosenbaum and Rubin 1983). 20 standard deviations. Based on various tutorials I created the following syntax (I have added the Stata syntax file and data file in. For these analyses, patients were matched on the logit of the propensity score using a caliper of 0. Measuring Balance and Model Selection in Propensity Score Methods 40 Propensity Score models model 1 logit(t) ˘ x1 + x2 + x4 + x5 + x7 + x8 + x2x4 + x2x7 + x7x8 + x4x5 + x 2 1 + x 2 7. Imbens et al. Propensity Modeling. Propensity score matching is used when a group of subjects receive a treatment and we’d like to compare their outcomes with the outcomes of a control group. Standardized.


text:
# Two Tricks Using Eisenstein's Criterion

Today we're talking about Eisenstein's (not Einstein's!) Criterion - a well-known test to determine whether or not a polynomial is irreducible.

Theorem (Eisenstein's Criterion) Let $R$ be a UFD and $p\in R$ be a prime. If $f(x)=x^n+a_{n-1}x^{n-1}+\cdots + a_0\in R[x]$ is a monic polynomial such that $p|a_i$ for each $0\leq i \leq n-1$ and $p^2\nmid a_0$, then $f(x)$ is irreducible in $R[x]$ )and hence in $F[x]$ where $F$ is the field of fractions of $R$).

Surely you've seen a standard type of example which makes use of this theorem:

$x^6+10x^2+15x+5$ is irreducible over $\mathbb{Z}$ since $5$ divides $10,15$ and $5$ but $5^2$ does not divide $5$.

But sometimes the use of Eisenstein's Criterion might not be so obvious and a trick may be needed. Today we consider two such examples.

## Trick #1

Let $p$ be a prime integer. Prove $\Phi_p(x)=\frac{x^p-1}{x-1}$ is irreducible in $\mathbb{Z}[x]$.

$\Phi_p(x)$ is called the cyclotomic $p$th polynomial and is special because its roots are precisely the primitive $p$th roots of unity. That $\Phi_p(x)$ is irreducible is quite an important fact (which, for instance, turns up frequently in Galois theory), but at first glace it's not obvious that Eisenstein's Criterion is even applicable. For that we need a trick (or, a fact, really):

$p(x)$ is irreducible $\quad \Longleftrightarrow\quad$ $p(x+1)$ is irreducible.

for any polynomial $p(x)\in R[x]$ for any UFD $R$. (This works because any factorization of $p(x)$, say $p(x)=f(x)g(x)$, corresponds to a factorization of $p(x+1)$, namely $p(x+1)=f(x+1)g(x+1)$.)
So $$\Phi_p(x+1)=\frac{(x+1)^p-1}{x}=\frac{ \sum_{k=0}^p\binom{p}{k}x^{p-k} \: -1 }{x}.$$ Notice that the numerator is equal to $x^p+px^{p-1}+\frac{1}{2}p(p-1)x^{p-2}+\cdots+\frac{1}{2}p(p-1)x^2+px$ and so the above becomes $$x^{p-1}+px^{p-2}+\frac{1}{2}p(p-1)x^{p-3}+\cdots+\frac{1}{2}p(p-1)x+p.$$ This satisfies the Eisenstein criterion at the prime $p$. The key is simply that each of the binomial coefficients $\binom{p}{k}$ for $1\leq k \leq p-1$ is divisible by $p$ since the $p$ in the $p!$ of the numerator never gets canceled.

Similarly, we can show that $x^4+1$ is "Eisenstein at 2" by using the same trick. One can see this quickly by noting that fourth row of Pascal's triangle is 1-4-6-4-1 and so the coefficents of $(x+1)^4+1$ must be $1-4-6-4-2$.

## Trick #2

Prove $x^2+y^2-1$ is irreducible in $\mathbb{Q}[x,y]$

Here we want to regard $\mathbb{Q}[x,y]$ as $\mathbb{Q}[x][y]$ so that our UFD is $R=\mathbb{Q}[x]$, and we want to view $x^2+y^2-1=y^2+(x+1)(x-1)$ as a monic polynomial in the variable $y$ with constant term $x^2-1\in R$. If we can show that $x+1$ (or similarly $x-1$) is a prime in $R$, then we can say $y^2+x^2-1$ is irreducible over $R$ since $x+1$ divides $(x+1)(x-1)$ but $(x+1)^2$ does not.

Indeed $x+1$ is prime. To see this, recall that it's enough to show $x+1$ is irreducible since we're in a UFD. This can be easily done with a degree argument.* OR if you're feeling extra fancy, you can take the high route: Notice that $$\mathbb{Q}[x]/(x+1)\cong \mathbb{Q}.$$ To see this, let $\varphi:\mathbb{Q}[x]\to\mathbb{Q}$ be the ring homomorphism given by $\varphi(p(x))=p(-1)$. Then $\varphi$ is surjective (any $q\in \mathbb{Q}$ has preimage $p(x)=x+q+1$) and $\ker\varphi$ is the ideal $(x+1)=\{(x+1)f(x):f(x)\in\mathbb{Q}[x]\}$. That $\mathbb{Q}[x]/(x+1)\cong \mathbb{Q}$ follows directly from the First Isomorphism Theorem. Thus since $\mathbb{Q}$ is a field, so is $\mathbb{Q}[x]/(x+1)$ which implies $(x+1)$ is a maximal ideal (as $\mathbb{Q}[x]$ is a commutative ring) and therefore $x+1\in \mathbb{Q}[x]$ is irreducible. (This is "using a sledge hammer to beat a flea"!)

Footnote:

* Here 'tis: Suppose $x+1$ factors in $\mathbb{Q}[x]$ as $x+1=f(x)g(x)$. Then we must have $1=\deg f(x)+\deg g(x)$ which can only happen if, say, $\deg f(x)=1$ and $\deg g(x)=0$. This means $f(x)$ is linear and $g(x)=g\in \mathbb{Q}$ is a nonzero unit of $\mathbb{Q}[x]$ (i.e. it's a constant). But this is precisely what it means for $x+1$ to be irreducible.

format: plain


text:
# Best LaTeX Editor [closed]

What's the best LaTeX editor you've used, and what would you recommend someone read to understand and become proficient with authoring papers/books in LaTeX?

• Try flagging the mods; nobody else has that much rep either :) Jul 15 '09 at 19:39
• Tagged it, but can't edit out your tagging request.
– pgs
Jul 20 '09 at 13:01
• I edited out your paragraph, but I had to change the title because the length requirement was increased since then. :) Oct 4 '10 at 19:07
• Both the questions of editors and guides have been covered extensively on the TeX Stackexchange. Jan 14 '11 at 13:36

Emacs has excellent support for LaTeX. Look for the AUCTeX package. I never got the hang of LyX admittedly, but maybe it has improved since I last tried it.

And just to brag a little I have seen Donald Knuth using Emacs with my very own eyes:-)

• Post flagged for bragging ;) Jul 16 '09 at 12:47
• +1 for name-dropping. I'm a proficient vi user myself, maybe I'll delve into emacs a little. Jul 16 '09 at 20:22
• And I can use VIPER for Vi bindings in Emacs. Sold. Jul 16 '09 at 20:45
• You should also mention that RefTeX is the best thing ever May 6 '10 at 12:54
• Also Leslie Lamport, author of LaTeX, uses Emacs and supplied to AUCTeX the descriptions of error messages. Mar 8 '17 at 21:52

For my latest work I used TeXnicCenter. It is pretty powerful, but also a bit complex to understand in the beginning ...

I recommend beginner to start with LyX as it is close to being a WYSIWYG editor for LaTeX (it's actually WYSIWYM). It's quite friendly runs on Linux/Unix, Windows, and Mac OS X so it can serve pretty much anybody.

A more advance version is LEd (LaTeX Editor) but this one is Windows Only.

• LyX is NOT a WYSIWYG editor, it is a WYSIWYM editor. Jul 20 '09 at 14:26
• Thank you Stefan for the comment on WYSIWYM. I've corrected the post to reflect what I meant and included reference to it. Jul 20 '09 at 16:28

If you are a programmer and use Eclipse, there is an Eclipse plugin that you can use to edit files. However, you need something like mikTeX to produce a PDF or PS file.

On Mac OS X, I use TextMate with its LaTex Bundle, and Skim as a PDF reader. On Windows, WinShell is a pretty good editor.

I use MacVim on Mac OS X and a makefile to create the pdf.

While Lyx is a nice WYSIWYG editor, if you want to learn latex I would say use a text editor with syntax highlighting or something like TexShop, which is made for tex editing.

• worth mentioning - OSX only Jan 31 '10 at 16:20

To make a start: you can use the Lyx editor and look at some online guides such as Tobi Oetiker's The Not So Short Introduction to LaTeX2e followed later by books that address specific requirements (Maths, science, graphics).

As confidence increases: Move to either an editor you already use and are comfortable with (e.g. emacs with the auctex extensions or vim/gvim with the latexsuite extensions) or a cross-platform editor such as TeXworks.

Useful texts at that stage can include: Kopka & Daly (2003), Guide to LaTeX (4th edn)

Mittelbach & Goosens (2004), The LaTeX Companion (2nd edn)

but you may also want something more 'practical' such as Kottwitz's LaTeX Beginner's Guide.

Samples from users in the same field or producing similar documents are also very helpful, as are their recommendations for books and on-line tutorials.

Before much longer you'll want to have a look at the original and classic book by Knuth: The TeXbook

I really like Kile.

The newest version (2.1) written for KDE4 has some issues at the moment but the KDE3.5 version (2.0) is rock solid. The integration with KDE is very good, the main editing environment being katepart.

The most impressive feature for me is the ability to preview selected text or the current environment in a tab in the editor window. There is also good auto-complete support and easy to use symbol lists.

• Love kile too, with all the automagic functionality. Aug 24 '09 at 12:12

I feel like I should give WinEdt a mention; I used it to write up my master's dissertation. It's Windows only, and it's not WYSIWY{G,M}, but it's got lots and lots of features specifically for working with LaTeX.

It's shareware, and I've managed to lose my licence, but if I had to do any LaTeX work on Windows again, I would buy another copy in an instant.

I second all the plugs for LyX. For ease and simplicity, it's great. But I had trouble configuring it to do some things: adjusting spacing between itemize items, etc. I always ended up tinkering with the TeX source in a separate editor.

For editing TeX directly, I use Texmaker, which is basic but has a lot of nice features, such as one-click rendering.

I use Vim and it works.

Inlage is a very modern LaTeX software with Windows7 tablet pc support. It has an intelligent autocompletion for many commands and symbols with descriptions, spellchecker, office table import, docking system, report window...

It's very easy to handle, e.g. setting up SumatraPDF with inverse/forwards should be not a problem for LaTeX beginners and takes not much time.


text:
Synopsis: A topological metal in one dimension

Nondegenerate Metallic States on Bi(114): A One-Dimensional Topological Metal

J. W. Wells, J. H. Dil, F. Meier, J. Lobo-Checa, V. N. Petrov, J. Osterwalder, M. M. Ugeda, I. Fernandez-Torrente, J. I. Pascual, E. D. L. Rienks, M. F. Jensen, and Ph. Hofmann

Published March 2, 2009

Conducting one-dimensional channels were known to exist at the edges of quantum Hall systems. Recently, similar metallic states were also discovered along the edges and surfaces of certain band insulators with large spin-orbit coupling, such as $\text{HgTe}$ quantum wells and $\text{Bi-Sb}$ alloy, respectively. These unusual metallic states constitute a pair with opposite spin and electron momentum and are “topologically protected” because deformations or addition of impurities to the surface can modify the conduction and valence-band states but cannot open a gap between them.

In Physical Review Letters, Justin Wells and colleagues from the University of Aarhus in Denmark, along with a multinational list of collaborators from Switzerland, Russia, Germany, and Spain report the finding of a one-dimensional topological spin-split surface metallic state on the $\left(114\right)$ surface of bismuth using scanning tunneling microscopy and photoemission spectroscopy. A reconstruction on this surface of bismuth produces straight atomic rows in the $x$ direction with a wide separation in the $y$ direction, giving rise to the one-dimensional character. Since bismuth is a semimetal and not an insulator, this surface state lies partly inside the bulk continuum of states. In contrast to the case of higher dimensions, spins in the one-dimensional topological metallic state are aligned with the momentum of the electrons rather than being perpendicular to it. The authors also predict that the same surface state is likely to be present in insulating ${\text{Bi}}_{0.9}{\text{Sb}}_{0.1}$ to give rise to a one-dimensional quantum spin Hall phase. – Sarma Kancharla


text:
# Sorting Networks

Sorting networks fascinate me. They even got me mentioned in Knuth Vol. 3, p. 666 of the second edition. My only coauthor in this work is my Penn State PhD student Bruce Parker.

# The Pairwise Sorting Network (1992)

Ian Parberry, "The Pairwise Sorting Network". Parallel Processing Letters, Vol. 2, No. 2,3, pp. 205-211, 1992. [pdf]

### Abstract

A new sorting network with exactly the same size and depth as the odd-even sorting network is presented. This sorting network is designed using the zero-one principle, and proceeds by first sorting pairs of bits and sorting the pairs into lexicographic order.

### Author's Comment

A 2010 paper by Michael Codish and Moshe Zazon-Ivry quotes my paper as saying: "It is the first sorting network to be competitive with the odd-even sort for all values of n. The value of the pairwise sorting network is not that it is superior to the odd-even sorting network in any sense, but that it is the first serious rival to appear in over 20 years", and they go on to say: "In this paper, almost 20 years after the introduction of pairwise sorting networks, we are in the position to state that pairwise sorting networks are significantly superior to odd-even sorting networks, at least for encoding cardinality constraints." Very cool.

# Sorting Network Verification Reloaded (1991)

Ian Parberry, "On the Computational Complexity of Optimal Sorting Network Verification". Proceedings of The Conference on Parallel Architectures and Languages Europe, Springer-Verlag Lecture Notes in Computer Science, Vol. 506, pp. 252-269, June 1991. [pdf]

### Abstract

A sorting network is a combinational circuit for sorting, constructed from comparison-swap units. The depth of such a circuit is a measure of its running time. It is reasonable to hypothesize that only the fastest (that is, the shallowest) networks are likely to be fabricated. It is shown that the problem of verifying that a given sorting network actually sorts is Co-NP complete even for sorting networks of depth only $4 \log n + O(1)$ greater than optimal. This is shallower than previous depth bounds by a factor of two.

# Sorting Network Verification (1990)

Ian Parberry, "Single-Exception Sorting Networks and the Computational Complexity of Optimal Sorting Network Verification". Mathematical Systems Theory, Vol. 23, pp. 81-93, 1990.

### Abstract

A sorting network is a combinational circuit for sorting constructed from comparison-swap units. The depth of such a circuit is a measure of its running time. It is known that sorting-network verification is computationally intractable. However, it is reasonable to hypothesize that only the fastest (that is, the shallowest) networks are likely to be fabricated. It is shown that the verification of shallow sorting networks is also computationally intractable. Firstly, a method for constructing asymptotically optimal single-exception sorting networks is demonstrated. These are networks which sort all zero-one inputs except one. More specifically, their depth is $D(n-1)+2\log (n-1)+2$, where $D(n)$ is the minimum depth of an $n$-input sorting network. It follows that the verification problem for sorting networks of depth $2D(n) + 6 \log n + O(1)$ is Co-NP complete. Given the current state of knowledge about $D(n)$ for large $n$, this indicates that the complexity of verification for shallow sorting networks is as great as for deep networks

# 9-Input Sorting Networks (1989, 1991)

Ian Parberry, "A Computer Assisted Optimal Depth Lower Bound for Nine-Input Sorting Networks". Mathematical Systems Theory, Vol. 24, pp. 101-116, 1991. A preliminary version of this paper appeared in the Proceedings of Supercomputing '89, pp. 152-161, Reno, Nevada, Nov. 1989. [pdf]

### Abstract

It is demonstrated, using a combination of theoretical and experimental computer science, that there is no nine-input sorting network of depth six. If a nine-input sorting network of depth six exists, then there exists one with very special structure. There is an efficient algorithm for constructing and testing comparator networks of this form. This algorithm was implemented and executed on a supercomputer.

### Author's Comment

This paper had the good fortune to be mentioned on p. 666 of the second edition of Donald Knuth's The Art of Computer Programming, Vol. 3, Sorting and Searching.

# k-sorters (1989)

Bruce Parker and Ian Parberry, "Constructing Sorting Networks from k-sorters", Information Processing Letters, Vol. 33, No. 3, pp. 157-162, 1989. [pdf]

### Abstract

We study the problem of using sorters of $k$ values to form large sorting and merging networks. For $n$ an integral power of $k$, we show how to merge $k$ sorted vectors of length $n/k$ each using $4 \log_k n - 3$ layers of $k$-sorters and $4 \log_k n - 5$ layers of k-input binary mergers. As a result, we show how to sort n values using $2 \log_k^2 n - \log_k n$ layers of $k$-sorters and $2 \log_k^2 n - 3 \log_k n + 1$ layers of $k$-input binary mergers.

Created April 21, 2010. Written in HTML 4.01 and CSS 3 using vi. Last updated October 17, 2014.


text:
# Newcommand not working in Lyx

I am using lyx for writing a latex document. The following is the preamble in Document > Settings:

\usepackage{fullpage}

\newcommand{\authnote}[1]{\textcolor{green}{\small {\textbf{(Auth:} #1\textbf{) }}}}

\usepackage{hyperref}

And the document contains only 1 line:

In the Ctrl+L environment: \authnote{aa}

It is giving an undefined control sequence error. What's the problem?

• Which sequence is reported is undefined? You use \textcolor so you need to load a package that defines that command, e.g. color or xcolor – Andrew Swann Jul 17 '16 at 7:33
• \usepackage{xcolor} worked! Thanks! Can you put the comment as an answer? I can accept it then. – stebahpla Jul 17 '16 at 7:36
• I'm voting to close this question as off-topic because it was solved by the comment below the question – Stefan Pinnow Jul 17 '16 at 11:41
• @StefanPinnow I would understand that it is off-topic as a package was missing. But answered in comments doesn't make something off-topic right? Also as the question has a real answer. You could also find a duplicate, but to me an undefined control sequesnce would be off-topic, as there are indefinitely many typos. – Johannes_B Jul 17 '16 at 13:42

Your command contains the macro \textcolor. This is not part of standard LaTeX, so you need to load an appropriate package. The two main choices are the color package from the graphics bundle, and the xcolor package which is an extension with many more predefined color names and access to different color models. So I suggest you add
\usepackage{xcolor}


text:
# Iterating in R

#### jamesmartinn

##### Member
Hi all,

I want to perform a set of data management tasks that involves the following:

-Input a data frame with an arbitrary number of columns, and column names, of numeric type.
-Check each value (i.e. entry) to see if it meets a condition
-If it does, replace the value

so as an example:

the input:
df_test <- data.frame(id=c(1,2), x1=c(1,6), x2=c(9,6), xt=c(10,12))

the condition:
if any entry in the data frame is in between 1-5 (inclusive), replace that value with another, say 9999999 (I've chosen this because it's so large that it's not possible in my actual data)

the return:
return a data frame with the numbers recoded if they meet the condition

I'm currently looking at purrr (a really basic tutorial, so I'm not sure if this is the best way to do my operation, and it may take me a while to get through it), and I'm wondering if this is a good starting point.

Thanks!

Edit: I've been able to get the logic kind of working, but not in a format / workflow I'll ultimately need it to be in. Any help is still/direction is greatly appreciated.

Code:
library(purrr)

inp <- 1:10

checksmall <- function(.x) {
if (.x %in% c(1,2,3,4,5)) {
.x <- 99999
} else {
.x <- .x
}
}

inp2 <- unlist(map(inp,checksmall))
Code:
> inp
[1]  1  2  3  4  5  6  7  8  9 10
> inp2
[1] 99999 99999 99999 99999 99999     6     7     8     9    10

Last edited:

#### Dason

purrr is way too advanced for the task you described. But I'd also suggest using NA instead of a large indicator value for the recode value. You could do the recode on all columns you want simultaneously very easily using base R.

#### jamesmartinn

##### Member
purrr is way too advanced for the task you described. But I'd also suggest using NA instead of a large indicator value for the recode value. You could do the recode on all columns you want simultaneously very easily using base R.
Thanks Dason! You're absolutely right it was way easier in base R. Thanks for the perspective.

Code:
df <- data.frame(x1=c(1,9,10), x2=c(11,43,3))
df[df==1|df==2|df==3|df==4|df==5] <- NA

> df
x1 x2
1 NA 11
2  9 43
3 10 NA

Any insight to as why the following doesn't work?

Code:
df[df %in% c(1,2,3,4,5)] <- NA
I realize I can do the following for the initial question I asked and get a good result.

Code:
df[df < 6] <- NA
In the future, I may need to use arbitrary values to recode (e.g. 1,2,3,4,5,18, 77, 100)

best,


text:
Recursion in Computer Science

Recursion, though important is frequently overlooked by programmers who do not understand its potential and place in algorithm design. It allows the expression of some problems in a very elegant and succinct manner, problems such as the famous Fibonacci number sequence are better understood and written with the aid of recursion. We will go through a few algorithms that employ It in an attempt to explain its function in a clear and concise manner.

I will be using python in this post because its a scripting language and therefore there is no need to recompile while testing my code. If you do not have python on you machine you can get it here python;  python IDE .

“A picture is worth a thousand words” is certainly true for this photo, in order for recursion to work there has to be at least one base case. The algorithm can have multiple base cases each of which is responsible for a particular state in which the algorithm may be in at each step. So lets look at our first example of a simple recursive function written in python.

Counting backwards from 10 to 0

def countDescending(num):
print num
if num == 0: return
countDescending(num - 1)

Analysis

1. The countDescending accepts a number as input then prints that number
2. Base case: When num = 0 return from the function.
3. Recursive step:The function calls itself with the input being reduced by 1

NB* All recursive solutions the initial problem must be one that can be broken down into simpler  problems, which eventually leads to the base case. Also to note, each function  call along  with scoped non-static variables are held on the stack until the base case is reached at which point the stack is unwound and the resources released.

Fibonacci Number

def fib(num):
if num < 2:return num
if num > 0 :return fib(num-1) + fib(num-2)

Analysis

Fibonacci Number sequence: 0, 1, 1, 2, 3, 5, 8
Recursive formula: $\displaystyle f_{n} = \sum_{n=1}^{8} (n-1)+(n-2)$
Base case: If input is less than 2 return the original input.
Recursive step: If input greater than 0 call fib with number – 1 and number – 2
Recursion Tree:

A recursion tree allows us to gain insight into the workings of a recursive algorithm, the above diagram shows the recursion tree for the Fibonacci number  8. From it we note that there is lot of repetition in calculation, this could be avoided with the use momoization which we will discuss in a future article.


text:
# nLab (infinity,1)-site

### Context

#### $(\infty,1)$-Topos Theory

(∞,1)-topos theory

## Constructions

structures in a cohesive (∞,1)-topos

# Contents

## Idea

The structure of an $(\infty,1)$-site on an (∞,1)-category $C$ is precisely the data encoding an (∞,1)-category of (∞,1)-sheaves

$Sh(C) \hookrightarrow PSh(C)$

inside the (∞,1)-category of (∞,1)-presheaves on $C$.

The notion is the analog in (∞,1)-category theory of the notion of a site in 1-category theory.

## Definition

The definition of $(\infty,1)$-sites parallels that of 1-categorical sites closely. In fact the structure of an $(\infty,1)$-site on an $(\infty,1)$-category is equivalent to that of a 1-categorical site on its homotopy category (see below).

###### Definition

($(\infty,1)$-Grothendieck topology)

A sieve in an (∞,1)-category $C$ is a full sub-(∞,1)-category $D \subset C$ which is closed under precomposition with morphisms in $C$.

A sieve on an object $c \in C$ is a sieve in the overcategory $C_{/c}$.

Equivalently, a sieve on $c$ is an equivalence class of monomorphisms $U \to j(c)$ in the (∞,1)-category of (∞,1)-presheaves $PSh(C)$, with $j : C \to PSh(C)$ the (∞,1)-Yoneda embedding. (See below for the proof of this equivalence).

For $S$ a sieve on $c$ and $f : d \to c$ a morphism into $c$, we take the pullback sieve $f^* S$ on $d$ to be that spanned by all those morphisms into $d$ that become equivalent to a morphism in $S$ after postcomposition with $f$.

A Grothendieck topology on the $(\infty,1)$-category $C$ is the specification of a collection of sieves on each object of $C$ – called the covering sieves , subject to the following conditions:

1. the trivial sieve covers – For each object $c \in C$ the overcategory $C_{/c}$ regarded as a maximal subcategory of itself is a covering sieve on $c$. Equivalently: the monomorphism $Id : j(c) \to j(c)$ covers.

2. the pullback of a sieve covers – If $S$ is a covering sieve on $c$ and $f : d \to c$ a morphism, then the pullback sieve $f^* S$ is a covering sieve on $d$. Equivalently, the pullback

$\array{ f^* U &\to& U \\ \downarrow && \downarrow \\ d &\stackrel{f}{\to}& c }$

in $PSh(C)$ is covering.

3. a sieve covers if its pullbacks cover – For $S$ a covering sieve on $c$ and $T$ any sieve on $c$, if the pullback sieve $f^* T$ for every $f \in S$ is covering, then $T$ itself is covering.

An $(\infty,1)$-category equipped with a Grothendieck topology is an $(\infty,1)$-site.

## Properties

### Of sieves

###### Lemma

A sieve $S'$ on $c$ that contains a covering sieve $S \subset S'$ is itself covering.

###### Proof

For every $f : d \to c$ an object of $S \subset C_{/c}$, the pullback sieve $f^* S'$ equals the pullback sieve $f^* S$. So it covers $d$ by the second axiom on sieves. So by the third axiom $S'$ itself is covering.

###### Proposition

There is a natural bijection between sieves on $c$ in $C$ and equivalence class of monomorphisms $U \to j(C)$ in $PSh(C)$.

This is HTT, prop. 6.2.2.5.

###### Proof

First observe that equivalence classes of $(-1)$-truncated object of $PSh(C_{/c})$ are in bijection with sieves on $c$:

An $(\infty,1)$-presheaf $F$ is $(-1)$-truncated if its value on any object is either the empty ∞-groupoid $\emptyset$ or a contractible $\infty$-groupoid. The full subcategory of $C_{/c}$ on those objects on which $F$ takes a contractible value is evidently a sieve (because there is no morphism from a contractible to the empty $\infty$-groupoid). Conversely, given a sieve $S$ on $c$ we obtain a (-1)-truncated presheaf fixed by the demand that it takes the value $* = \Delta[0] \in \infty Grpd$ on those objects that are in $S$, and $\emptyset$ otherwise.

Now, as described at Interaction of presheaves and overcategories we have an equivalence

$PSh(C_{/c}) \simeq PSh(C)_{/j(c)} \,.$

Under this equivalence our bijection above maps to the statement that there is a bijection between sieves on $c$ and equivalence class of $(-1)$-truncated objects in $PSh(C)_{/j (c)}$. But such a (-1)-truncated object is precisely a monomorphism $U \to j(c)$.

### Of coverages

###### Observation

The set of Grothendieck topologies on an $(\infty,1)$-category $C$ is in natural bijection with the set of Grothendieck topologies on its homotopy category.

This is HTT, remark 6.2.2.3.

###### Proof

Because picking full sub-1-categories as well as full sub-$(\infty,1)$-categories amounts to picking sub-sets/sub-classes of the set of equivalence classes of objects.

###### Corollary

If the $(\infty,1)$-category $C$ happens to be an ordinary category (for instance in its incarnation as a quasi-category it is the nerve of an ordinary category), then the structure of an $(\infty,1)$-site on it is the same as the 1-categorical structure of a site on it.

### Of sites

###### Proposition

Structures of $(\infty,1)$-sites on an (∞,1)-category $C$ correspond bijectively to topological localizations of the (∞,1)-category of (∞,1)-presheaves to a (∞,1)-category of (∞,1)-sheaves. See there for more details.

## Incarnations and models

If (∞,1)-categories are incarnated as simplicially enriched categories, then an $(\infty,1)$-site appears as an

If $(\infty,1)$-categories are presented by model categories, then the notion of $(\infty,1)$-site appears as that of

## Examples

• The trivial Grothendieck-topology on an $(\infty,1)$-category is that where the only covering sieve on each object $c$ is $C_{/c}$ itself. Equivalently, where the only covering monomorphisms $U \to j(c)$ in $PSh(C)$ are the equivalences.

The (∞,1)-category of (∞,1)-sheaves on this site is just the (∞,1)-category of (∞,1)-presheaves itself. The localization is an equivalence.

• étale (∞,1)-site

## References

Section 6.2.2 of

Revised on March 29, 2014 13:26:04 by Anonymous Heru? (188.100.50.220)


text:
Gazebo projectors only work on links connected with revolute joints? [closed]

I have a work-around for some very unexpected behavior with using projectors in Gazebo, I'm posting some findings here so searches can find it before probably creating a bug report.

So far what is working mostly reliably is to place a projector on a link that is connected via a revolute joint to another link. Aiming the projector is accomplished by adjusting the joint xyz rpy, not the projector pose. The link needs to have inertial properties.

This is the expected output for a projector pointing at the horizon:

If the joint is fixed, it can cause the projected texture to disappear, or work in a glitchy way. If projector pose is adjusted it either has no effect at all, or produces glitchy output like seen below:

This is another case where sections of the image are projected backwards (the small version of the texture is a projector hooked up to the 'head' link of the robot, since it is attached to base_link by a fixed joint I can't aim it at all with the projector pose):

This is part of an investigation that also led to http://answers.gazebosim.org/question... and http://answers.gazebosim.org/question... (the latter is maybe partially solved though I need to document it). I thought I'd try out the ros site for this one since those two haven't generated any responses.

There is an example robot in https://github.com/lucasw/testbot that demonstrates most of the behavior, roslaunch testbot_gazebo testbot_gazebo.launch should bring it up.

edit retag reopen merge delete


text:
# Tag Info

## New answers tagged weyl-group

3 votes

### Particular reduced expression of the longest element of Weyl group

As I mentioned in a comment, this is a special case of finding a distinguished representative for a coset of a parabolic subgroup. Let's inductively define elements $w_n$, with the convenient ...
• 8,703
5 votes
Accepted

### Particular reduced expression of the longest element of Weyl group

Whenever $\ell(wv)=\ell(w)+\ell(v)$, you can construct a reduced word for $wv$ by producing one for $w$ and one for $v$ and then concatenating them. So, if you know an algorithm for producing reduced ...
• 41.8k
9 votes
Accepted

### Invariants of cohomology of Springer sheaf

You want to look at the partial Grothendieck-Springer resolution, i.e. the variety of pairs $(g \in G/ P_\mu, v \in g \mathfrak p_\mu g^{-1})$. The partial Grothendieck-Springer resolution is smooth, ...
• 119k

Top 50 recent answers are included


text:
# Space Curves

Nicholas Schmitt

### Description

Elastic plane curves are finite type curves in 2-dimensional spaceforms. These curve minimize the total squared curvature. These curves were investigated by Euler in 1744 [1].

Figure 1depicts the elastic plane curves in $\mathbb{R}^2$ of spectral genus 1 are shown in the first figure. The 1-looped example (fourth from left) with singular spectral curve demarcates the orbitlike (left) from the wavelike (right). The orbitlike starting at the singular example flow left, converging to a circle. The wavelike starting at the singular example flow right, passing through the closed Euler lemniscate, converging to a straight line.

Figure 2 depicts a sampling of closed finte type curves in $S^2$ with low spectral genus. The elastic curve (first curve) with spectral genus 1 and six lobes, is symmetric about the equator. It can flow isoperiodically through constrained elastic curves with spectral genus 2 (second curve). The lemniscate (third curve) has spectral genus 1. These curves are profile curves of constrained Willmore Hopf tori[2][3].

Figure 3 depicts a sampling of elastic curves in $H^2$ of spectral genus 1. The first three curve are wavelike. The last two closed orbitlike curves are related to profile curves of constant mean curvature tori of revolution[3][4].

Circletons are finite type curves in Euclidean space. Figure 4 depicts closed planar simple circletons (simple factor dressings of the circle) in $\mathbb{R}^2$. These curves are parametrized by pairs of positive integers $(\ell, w)$ satisfying $\ell < w$, where $\ell$ is the lobe count and $w$ is the wrapping number of the underlying circle. The image depicts circletons for small $\ell$ and $w$: the rows are indexed by $w=2,…,7$ and the columns by $\ell=1,…,w-1$.

Figure 5 depicts the border line elastic curve, the unique (up to homothety) elastic planecurve in $\mathbb{R}^2$ with singular spectral curve. With arclength parametrization $(t-tanh 2t,sech 2t)$, it is a simple factor dressing of the vacuum $(t,\,0)$. As indicated by the struts, the pointwise distance between the straight line and the Euler loop as arclength parametrized curves is constant 1.

Figure 6 depicts an isospectral flow through closed simple circletons (simple factor dressings of the circle) in $\mathbb{R}^3$. From right to left, the planar circleton (also appearing in the top row of the first figure) deforms to a 2-wrapped circle in the limit. The spectral curve for this family is singular with algebraic genus 2 and geometric genus 0.

Figure 7 depicts The Euler lemniscate (first curve), the unique closed elastic planecurve in $\mathbb{R}^2$ up to homothety; it is finite type with spectral genus 1. The image shows two views of the spacecurve in $\mathbb{R}^3$ constructed by dressing the Euler lemniscate by a simple factor, preserving closing Its spectral curve is singular.

At last we see flows through finite type spacecurves in Euclidean 3-space. Figure 8 depicts an isospectral flow through closed finite type spacecurves in $\mathbb{R}^3$ of spectral genus 2. The curve returns to a translation of itself. This is an example of a vortex filament flow. The spacecurves are spherical by with changing sphere radius.

Figure 9 depicts an isoperiodic flow through elastic torus knots in $\mathbb{R}^3$ of spectral genus 1, from a 2-wrapped circle to a 3-wrapped circle. In contrast to isospectral flows, the spectral curve changes during isoperiodic flow. Both flows preserve the closing of the spacecurves.

### References

• Leonhard Euler.
Methodus inveniendi lineas curvas maximi minimive proprietate gaudentes, sive solutio problematis isoperimetrici lattissimo sensu accepti.
1744.
URL: eulerarchive.org.
• Christoph Bohle, Paul Peters, and Ulrich Pinkall.
Constrained Willmore surfaces.
Calc. Var. Partial Differential Equations, 2008.
URL: https://mathscinet.ams.org/mathscinet-getitem?mr=2389993.
• Lynn Heller.
Constrained Willmore tori and elastic curves in 2-dimensional space forms.
Comm. Anal. Geom., 2014.
URL: https://mathscinet.ams.org/mathscinet-getitem?mr=3210758.
• Martin Kilian, Martin Schmidt, and Nicholas Schmitt.
Flows of constant mean curvature tori in the 3-sphere: The equivariant case.
preprint, 2010.
arXiv:1011.2875.

#### Dr. Nicholas Schmitt   +

University: TU Berlin
Website: http://page.math.tu-berlin.de/~schmitt/


text:
# How can I use an hbox inside a TikZ environment for text dimension measurement?

I'm trying to use an \hbox to measure the dimensions of a certain text. This is working in normal text as in the following example:

\setbox37=\hbox{this is a text that I want to measure}
text width is \the\wd37, text heigh is \the\ht37\\
text contents: \box37

The output is correct as I expected:

text width is 159.63913pt, text heigh is 6.94444pt
text contents: this is a text that I want to measure

However, when trying to do the same inside a TikZ environmnet, the box I'm using is not assigned the text I pass to \hbox, instead I gets empty box with zero width & height. Here is the code:

\begin{tikzpicture}
\setbox37=\hbox{this is a text that I want to measure}
\node[draw] at (0,0) {text width is \the\wd37, text heigh is \the\ht37};
\node[draw] at (0,-1) {text contents is \box37};
\end{tikzpicture}

And here is the output:

What am I missing here?

-

PGF/TikZ takes care that non-drawing material inside its picture environments is not typeset. The whole environment is stored in a box which is later discarded while (IMHO) the drawing commands draw in a different box which is then typeset. This alone wouldn't be an issue for your code, but PGF/TikZ also sets the font to \nullfont as well redefines \selectfont to suppress font changes. Only for node contents and other "official" text like labels the font is restored.

Therefore the text in your box can't be typeset and the box is empty. A trace with \tracingall gives you the following messages:

{\setbox}
{the letter t}
Missing character: There is no t in font nullfont!
{the letter h}
Missing character: There is no h in font nullfont!
{the letter i}
...

You need to either set the box outside the picture environment or restore the font. You can use the pgfinterruptpicture environment to escape to a normal typesetting state with font.

\documentclass{article}
\usepackage{tikz}

\newbox\mybox

\begin{document}
\begin{tikzpicture}
\setbox\mybox=\hbox{\pgfinterruptpicture this is a text that I want to measure\endpgfinterruptpicture}
\node[draw] at (0,0) {text width is \the\wd\mybox, text heigh is \the\ht\mybox};
\node[draw] at (0,-1) {text contents is \box\mybox};
\end{tikzpicture}
\end{document}

Alternatively you could restore \selectfont and the font manually just for the box content:

\documentclass{article}
\usepackage{tikz}

\newbox\mybox
\let\origselectfont\selectfont
\newcommand{\restorefont}{%
\let\selectfont\origselectfont
\normalfont
}
\begin{document}
\begin{tikzpicture}
\setbox\mybox=\hbox{\restorefont this is a text that I want to measure}
\node[draw] at (0,0) {text width is \the\wd\mybox, text heigh is \the\ht\mybox};
\node[draw] at (0,-1) {text contents is \box\mybox};
\end{tikzpicture}
\end{document}

### Some other notes:

• You shouldn't use plain numbers for boxes. Box #37 might be used by some other code. My first guess was that TikZ uses it and sets it to be empty :-)
• AFAIK with the \setbox primitive there might be issues with color changes. Use \sbox\mybox{<content>} instead which handles them.
-
Thanks for explaining the reason; I knew how to solve the problem using \global\setbox but didn't know why it was necessary to do so. –  Gonzalo Medina May 19 '11 at 14:59
@Martin thanks for the explanation. using pgfinterruptpicture works for me. –  John Kirollos May 19 '11 at 16:09
@John: You are welcome. Please always also up-vote the answers you accept. –  Martin Scharrer May 19 '11 at 16:17
I find it miraculous that this problem, which I thought was too obscure to ever have been asked, has not only been asked but been answered so well (and just one month ago). –  Ryan Reich Jun 21 '11 at 17:12
Also, the PGF manual says that {pgfinterruptpicture} is intended for use inside a box. If you put it there, you no longer need to use \global (I tested this and it works). –  Ryan Reich Jun 21 '11 at 17:23


text:
Special Session 108: New Developments in porous media
 Self-similar viscous gravity currents in heterogeneous porous media: Second-kind solutions
 Ivan C Christov Purdue UniversityUSA Co-Author(s):    Z. Zheng, H. A. Stone
 Abstract: We summarize our recent combined experimental-theoretical-computational study of the effects of horizontal heterogeneities on the propagation of viscous gravity currents with applications to porous media flows. Our model geometry is a horizontal channel (specifically, a Hele-Shaw cell) with variable gap thickness in the streamwise direction in the form of a power law. We demonstrate that two types of self-similar behaviors emerge as a result of such horizontal heterogeneity: (a) a first-kind solution is found using dimensional analysis for currents that propagate away from the origin (a point of zero permeability); (b) a second-kind solution is found using a phase-plane analysis for viscous gravity currents that propagate toward the origin. Using the phase-plane formalism, we are able to construct the universal second-kind self-similar current shape. Additionally, still employing self-similar intermediate asymptotics and the phase-plane formalism, we identify self-similar behaviors in the post-closure regime, i.e., once the current reaches the geometric origin and begins to fill the model porous medium. The theoretical predictions show good agreement with lab-scale experiments using Hele-Shaw cells and also numerical solutions of the governing partial differential equation developed under the lubrication approximation. Z. Zheng, I.C. Christov, H.A. Stone, {\it J.\ Fluid Mech.}\ {\bf 747} (2014) 218-246, doi:10.1017/jfm.2014.148.


text:
# The voter model chordal interface in two dimensions

Mark Holmes, Yevhen Mohylevskyy, Charles Newman

Research output: Contribution to journalArticle

### Abstract

Consider the voter model on a box of side length $$L$$L (in the triangular lattice) with boundary votes fixed forever as type 0 or type 1 on two different halves of the boundary. Motivated by analogous questions in percolation, we study several geometric objects at stationarity, as $$L\rightarrow \infty$$L→∞. One is the interface between the (large—i.e., boundary connected) 0-cluster and 1-cluster. Another is the set of large “coalescing classes” determined by the coalescing walk process dual to the voter model.

Original language English (US) 937-957 21 Journal of Statistical Physics 159 4 https://doi.org/10.1007/s10955-015-1198-9 Published - 2015

### Fingerprint

Voter Model
Two Dimensions
coalescing
Geometric object
Triangular Lattice
Vote
Stationarity
Walk
boxes

### Keywords

• Coalescing random walks
• Interface
• Percolation
• Voter model

### ASJC Scopus subject areas

• Statistical and Nonlinear Physics
• Mathematical Physics

### Cite this

The voter model chordal interface in two dimensions. / Holmes, Mark; Mohylevskyy, Yevhen; Newman, Charles.

In: Journal of Statistical Physics, Vol. 159, No. 4, 2015, p. 937-957.

Research output: Contribution to journalArticle

Holmes, Mark ; Mohylevskyy, Yevhen ; Newman, Charles. / The voter model chordal interface in two dimensions. In: Journal of Statistical Physics. 2015 ; Vol. 159, No. 4. pp. 937-957.
@article{67d4b2aa2ea14f3088e7d13e3e7d9cc5,
title = "The voter model chordal interface in two dimensions",
abstract = "Consider the voter model on a box of side length $$L$$L (in the triangular lattice) with boundary votes fixed forever as type 0 or type 1 on two different halves of the boundary. Motivated by analogous questions in percolation, we study several geometric objects at stationarity, as $$L\rightarrow \infty$$L→∞. One is the interface between the (large—i.e., boundary connected) 0-cluster and 1-cluster. Another is the set of large “coalescing classes” determined by the coalescing walk process dual to the voter model.",
keywords = "Coalescing random walks, Interface, Percolation, Voter model",
author = "Mark Holmes and Yevhen Mohylevskyy and Charles Newman",
year = "2015",
doi = "10.1007/s10955-015-1198-9",
language = "English (US)",
volume = "159",
pages = "937--957",
journal = "Journal of Statistical Physics",
issn = "0022-4715",
publisher = "Springer New York",
number = "4",

}

TY - JOUR

T1 - The voter model chordal interface in two dimensions

AU - Holmes, Mark

AU - Mohylevskyy, Yevhen

AU - Newman, Charles

PY - 2015

Y1 - 2015

N2 - Consider the voter model on a box of side length $$L$$L (in the triangular lattice) with boundary votes fixed forever as type 0 or type 1 on two different halves of the boundary. Motivated by analogous questions in percolation, we study several geometric objects at stationarity, as $$L\rightarrow \infty$$L→∞. One is the interface between the (large—i.e., boundary connected) 0-cluster and 1-cluster. Another is the set of large “coalescing classes” determined by the coalescing walk process dual to the voter model.

AB - Consider the voter model on a box of side length $$L$$L (in the triangular lattice) with boundary votes fixed forever as type 0 or type 1 on two different halves of the boundary. Motivated by analogous questions in percolation, we study several geometric objects at stationarity, as $$L\rightarrow \infty$$L→∞. One is the interface between the (large—i.e., boundary connected) 0-cluster and 1-cluster. Another is the set of large “coalescing classes” determined by the coalescing walk process dual to the voter model.

KW - Coalescing random walks

KW - Interface

KW - Percolation

KW - Voter model

UR - http://www.scopus.com/inward/record.url?scp=84939942866&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=84939942866&partnerID=8YFLogxK

U2 - 10.1007/s10955-015-1198-9

DO - 10.1007/s10955-015-1198-9

M3 - Article

AN - SCOPUS:84939942866

VL - 159

SP - 937

EP - 957

JO - Journal of Statistical Physics

JF - Journal of Statistical Physics

SN - 0022-4715

IS - 4

ER -


text:
My Math Forum Equation of a cylinder in 3 dimensional space.

 Algebra Pre-Algebra and Basic Algebra Math Forum

 December 26th, 2012, 03:21 AM #1 Joined: Dec 2012 Posts: 2 Thanks: 0 Equation of a cylinder in 3 dimensional space. Hi Friends, Please, I like to know the equation of a cylinder with a given radius, r and a given height, h in 3 dimensional space(x,y,z). We need this in other to verify whether a given point, say (1,2,3) is in the cylinder or not. Thanks.
 December 26th, 2012, 03:25 AM #2 Math Team   Joined: Nov 2010 From: Greece, Thessaloniki Posts: 1,953 Thanks: 116 Math Focus: pre pre pre pre pre pre pre pre pre pre pre pre calculus Re: Equation of a cylinder in 3 dimensional space. [color=#000000]$x^2+y^2=r^2$ where r is a number and it is the radius of the cylinder.[/color]
 December 26th, 2012, 03:42 AM #3 Senior Member   Joined: Mar 2012 From: Belgium Posts: 646 Thanks: 10 Re: Equation of a cylinder in 3 dimensional space. in that equation there is no height included so it has to be over an interval for z

 Tags cylinder, dimensional, equation, space

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post maddieline Algebra 0 September 4th, 2013 11:16 AM edunwaigwe@yahoo.com Economics 1 December 26th, 2012 05:57 AM OriaG Calculus 2 September 4th, 2012 12:23 PM aaron-math Calculus 2 January 28th, 2012 12:53 PM elim Abstract Algebra 4 April 29th, 2010 10:52 AM

 Contact - Home - Top


text:
# Is a bijective smooth function a diffeomorphism almost everywhere?

Suppose I have $f: M \rightarrow N \in C^{\infty}$ a smooth bijection between $n$-dimensional smooth manifolds. Does it have to be a diffeomorphism except for a set of measure 0?

I think the proof might come from showing that $X = \{p: d_pf \text{ is not an isomorphism}\}$ has measure zero. Using the inverse function theorem you can show that the statement follows from this. By Sard's theorem, we know that $f(X)$ has measure zero, but I don't know how to go from there to $X$ having measure zero (since we don't know, for example, that $f^{-1}$ is locally Lipschitz).

You may assume (if you want) that $M$ and/or $N$ are connected and/or compact.

Thanks!

• "except for a set of measure 0" in M or in N?   – user57159 Jul 6 '16 at 19:20
• In $M$. Meaning the set $Z = \{p: \text{there does not exist an open set$U$that contains$p$on which$f|_U$is a diffeomorphism to it's image}\}$ has measure 0. Note that since $f$ is smooth this implies the same for $f^{-1}$ because $f(Z)$ would have measure zero. – Martin Arjovsky Jul 6 '16 at 20:19
• The smooth restriction is significant, and probably makes this true. I can break it if I'm allowed to be non-smooth (but continuous!) at a set of measure zero, and a diffeomorphism elsewhere. Indeed apply uniformization on the interior of a Jordan curve of positive measure and then Caratheodary's theorem, and then take the inverse of this. (Do this to both sides of the circle.) – user98602 Jul 6 '16 at 21:36

I think the answer is no. Suppose $E\subset \mathbb R$ is closed, has positive measure, and has no interior (for example, $E$ could be the complement of an open set of small measure containing the rationals).
As is well known, there exists a $C^\infty$ function $f: \mathbb R\to [0,\infty)$ such that $f=0$ on $E$ and $f>0$ on $\mathbb R \setminus E.$ Define
$$F(x) = \int_0^x f(t)\, dt.$$
If $x<y,$ then $F(y) - F(x) = \int_x^y f.$ Because $f \ge 0$ and $[x,y]$ contains an interval in the complement of $E,$ this integral is $>0,$ hence $F(y) > F(x).$ Thus $F,$ which is $C^\infty,$ is strictly increasing, hence is a bijection onto $F(\mathbb R),$ a nice open interval. But $F'(x) = f(x)$ everywhere. Since $f= 0$ on $E,$ $F$ fails to be a local diffeomorphism at each point of $E,$ a set of positive measure.


text:
# Best answer for people concerned about RPG activities being occult or dangerous?

I've had many experiences where the very fact of roleplaying triggered some concerned comment from the "uninitiated," likely parents or neighbors. Some examples:

• A friend of mine hosted a Vampires session in a small square in his neighborhood, during a very nice summer evening. They played by candlelight (citronella ones, since mosquitoes are a bane where I lived). Neighbors were concerned that a satanic ritual was in progress.
• I've been asked by my parents what kind of game this "roleplaying game" is, and "are you sure is not some kind of strange thing?" When I explained it to them, they didn't understand exactly how it worked. Ironically, my parents when young were crucial players in the deployment of the historical restoration of my city's Palio, which can be rightfully defined "LARP on steroids."
• A friend of mine (a young but highly skilled medical doctor who had already saved some lives) was stopped by a preacher: he replied that he was not interested, since his god was already Bahamut, describing him as a good dragon. Clearly a joke, but the preacher cowered away saying that it was an evil plot of the devil.

Now, we mostly laugh at these things. Personally, the best answer I was able to use as a comeback was, "The fact that you played a lot of Monopoly in your youth didn't turn you into an evil corporate executive who bankrupts friends and sniffs coke with their money."

My question is: has this situation happen to you? What is the best answer to give as a simple comeback?

-
The Monopoly argument is made of sheer genius. – Tsojcanth Aug 27 '10 at 12:15
Just check first that they aren't actually an evil corporate executive… – Paul Hutton May 16 '14 at 2:08
A LARP I'm involved with bills itself as "interactive theater". It's impressive how much more respectable many people see it after they hear that. – MrTheWalrus May 19 '14 at 20:53
If I need a once-sentence explanation I normally say "Roleplaying is like a blend of a board game and improvisational theater.". While not very accurate, there is some truth in it and has the benefit of using an association with theater which is generally (quite positively) regarded as an art form. – fgysin Feb 24 at 13:55

In the early 80s, we played AD&D, Gamma World and other games at the local pizza parlor in our town. Some concerned citizens/religious whack-jobs/folks got wind that we were doing that and started dropping off Chick Tracts with us. It was the heyday of D&D fear and I had friends with parents who would hear some crazy untruths about D&D and take away (and even destroy!) all their game-books.

But these folks -- whom we dismissed at first, really wanted to save our heathen butts. So eventually, we engaged them in conversation. At one point they claimed that anything you do with your time that doesn't glorify Christ is an abomination. They didn't have a good answer about the value of picking your nose or putting on your shoes. But they were actually civil and well-mannered. We tried to get them to join us for a game -- to tell us how it was sinful. They watched a bit but would never play. They also stopped coming around.

I like to hope that maybe they learned something and changed their priorities.

I haven't really encountered anything like that since.

-
There are also excellent resources on the web, like TheEscapist.com's page about "Bad Things" in RPGs that describe and debunk many of the myths about roleplaying games being satanic or otherwise bad. If the person who is concerned is open to reading an article from the RPG side discussing these claims, it can be an invaluable way to give them a better perspective of what the games really are about. – Thunderforge May 15 '14 at 21:11
@clweeks - Wow, that's completely insane. Somehow my friends and I missed out on all of the D&D panic in the 1980s. In fact our parents once hired the college kid who lived down the street to DM a D&D game for us - he was paid \$6/hour. Maybe living in a university town made it a more permissive environment concerning RPGs, but there were still plenty of religious nuts around. – RobertF May 20 '14 at 15:30

Most of them go away once invited to sit and listen to it. The older generation generally knew what a "radioplay" was, so I could describe RPGs as improvisational radioplays with dice to reduce player control of outcomes and prevent the old Cops-n-Robbers "I shot you!" - "No, you missed me."

After age 18, if I had a player under 17, I'd insist that a parent give permission. Many asked to sit in. One joined in.

-

Outline of a response: "I'm an adult who is gainfully employed, pays my bills and taxes, and doesn't break the law nor do I encourage immoral or illegal behavior in others. That I choose a hobby that is, for me, an enjoyable creative outlet is perfectly acceptable. Reasonable adults allow that other reasonable adults can engage in activities they find silly, stupid, or useless without those people ceasing to be reasonable adults. They even realize other reasonable adults might have the same opinions of their hobby and laugh it all off as part of the human comedy."

Remember, such a response must be tailored to the audience. If it's your parents expressing concern about how this could change your behavior emphasize that it is not impacting your attending to responsibilities, other parts of life, or leading to immoral behavior (and if it is then perhaps you do need to attend to it). If it's a busy-body neighbor them turn up the snark if you like.

-
Please keep in mind that for many people this could be considered as condescending - if I were a parent being genuinely worried for my kid (even if said kid was 40 or so) this answer would not only fail to calm me, but it would also make me feel disappointed and sad. Don't settle for a 'best comeback' if the people you're talking to are worried about you. – Maurycy May 15 '14 at 14:18

I also always used Monopoly as an example; only I always asked them if they thought Monopoly could be blamed for making people participate in insider trading.

-
I played Tetris when I was a kid, and now I'm a construction worker! WHERE IS MY LAWSUIT MATERIAL – Logan MacRae Aug 27 '10 at 12:41

Back in the '80s one of the first people I gamed with was a pretty unlikely gamer. His dad worked for the sheriff's department, was a religious conservative, and at first blush would never be the kind of parent who would allow his son anywhere near D&D (or The Arduin Grimoire for that matter).

But my friend Steve was pretty savvy about it. He showed his dad the 1st ed. AD&D books and honed in on the areas where Gygax called attention to the influences on the game, and how it was about epic adventure. He showed the character classes, the evil monsters that were the opposition, and he talked his dad through a simple scenario, analogizing it to Tolkien books and '50s B-movies.

He took the mystery out of these games by explaining them in terms his father could relate to and understand. Every Saturday afternoon as we sat in the garage playing, Steve's dad would pop in and crack jokes about us smoking pot. Obviously he was a lot happier knowing we were safe in his garage sitting around a table telling stories than getting into actual trouble.

-

It's never happened to me, thankfully. I would add the excellent Pulling Report from Mike Stackpole to the pile of things you can show people -- it's somewhat dated now but it did a lot to help our image back in the 90s.

-

For those who face opposition to RPGs from Christians, I would like to recommend the Christian Gaming Guild. It's a page created by Christians role-players, defending the industry and hobby from a Christian POV, and its FAQ section includes articles touching on the subject of RPG and covers basic questions as to what is a RPG, whether is related to the occult etc. There's also a Chaplain section which reconciles elements of RPG to the Christian faith.

It also features links to other articles and resources on the web that may help.

-

Although a lot of people you encounter in casual conversation might not be interested, there are some good academic responses that were written back from the days of BADD (Bothered About Dungeons & Dragons). I recommend a chapter from The Satanism Scare edited by Daniel Martin and Gary Alan Fine called "Satanic Cults, Satanic Play: Is 'Dungeons & Dragons' a Breeding Ground for the Devil?"

There are a number of other references I can get, including a paper I've written in my graduate work, if you are interested.

-

Something I like to do is find a role playing game with an incredibly friendly face on it that is good to go for a single session. Don't present it as a role playing game, present it as you would present any board game. Then after the game is over "HAHA! you just played a role playing game!" That will teach most people their lesson.

-
I can't help but imagine that this would actually be almost impossible to pull off in reality. It would be too easy for a person biased against RPGs to reason that since you refused to show them the rules, you must be hiding all the really bad stuff. – GMJoe Feb 22 '12 at 6:06
@GMJoe: So play an RPG that doesn't look like it when you show the rules. (Dread, Monkey, Microscope, Fiasco.) – Tynam Jul 9 '12 at 9:49