similar to: Running/submitting script files

Displaying 20 results from an estimated 1000 matches similar to: "Running/submitting script files"

2007 Jun 26
1
Subscripting specified variables in a function
I'm trying to create a function which will allow me to subset a data set based on values of various specified variables. I also want to then apply some other function(s) (e.g., summary). This is what I've tried so far.... > test.fx <- function(dta, expvar, expval) { + newdta <- subset(dta, eval(expvar)>expval) + summary(newdta$eval(expvar)) + } > >
2003 May 07
2
"Program" files
Is there any such thing as a program file in R? That is, is it possible to compile and save code for performing data management and analytic tasks for a given project into a single/multiple file(s) (i.e., like a script file (S-Plus), a do file (STATA), or a *.sas file (SAS))? Any words of wisdom or a point in the direction of some documentation would be helpful. If it is not possible to work
2004 Apr 14
1
Variable Descriptors
Is there a way to associate text descriptions with variables in a data.frame? For example... Let's say that in my data.frame I have a variable named var1. var1 represents the responses to the question "When was the last time you saw your physician?" When I tabulate the variable var1 I'd like the output to be a bit more descriptive and contain the more descriptive
2003 Apr 24
3
Detailed contingency tables
Is there any existing function for creating contingency tables that will display counts, row, column, and cell percentages in the same tables....anything similar to crosstabs in S? Marc W. Zodet, MS Health Statistician Center for Cost and Financing Studies Division of Statistical Research and Methods 2101 East Jefferson Street, Suite 500 Rockville, Maryland 20852 Phone: 301-594-7072 Fax:
2004 Jul 23
2
Complex Surveys...Specifying Design
I need some guidance from someone who is familiar/has some experience with the survey package. The data that I am using is from the Medical Expenditure Panel Survey (www.meps.ahrq.gov <http://www.meps.ahrq.gov/> ). The STRATA and PSU variables are varstr01 and varpsu01 respectively. When I try to specify them with the svydesign function I get an error message. An excerpt of my session
2006 Sep 20
1
Simulation help
I'm trying to simulate trend data over a five year period. I want different trend profiles...the simplest being a linear trend. I've been using the following code: patBdta1 <- NULL for(i in 1:100) patBdta1 <- rbind(patBdta1,c(yr1= mean(rbinom(50,1,.50)), yr2 =mean(rbinom(50,1,.51)), yr3 =mean(rbinom(50,1,.52)),
2006 Jul 14
2
R as shell script
Hi, I am considering if I should invest in learning R. Based on the language definition and introductory documents, it seems nice. But now I am faced with a problem: I want to be able to run R programs easily from the unix shell, and write scripts that can automatically select R as the interpreter: #!/usr/bin/R cat("Hello world.\n") This of course doesn't work, because /usr/bin/R
2006 Jul 14
2
R as shell script
Hi, I am considering if I should invest in learning R. Based on the language definition and introductory documents, it seems nice. But now I am faced with a problem: I want to be able to run R programs easily from the unix shell, and write scripts that can automatically select R as the interpreter: #!/usr/bin/R cat("Hello world.\n") This of course doesn't work, because /usr/bin/R
2003 Sep 11
2
Sorting
What is the best way to sort a dataframe? For example, how would I go about sorting a dataframe (with variables V1-V5) by ascending V1, V2 and descending V3 while retaining V4 and V5. Also, is there a relatively easy way by which to re-order my columns? Thank you for your time. Marc Marc Zodet [[alternative HTML version deleted]]
2003 Sep 30
1
Stepwise procedures
Is there a function in R which performs stepwise estimation in ways similar to SAS/STATA (i.e., allows the analyst to specify the significance levels for removal/addition of terms). I've been asked to evaluate two final models: one resulting from a backwards selection in R (stepAIC) and one resulting from a backwards selection using PROC LOGISTIC in SAS. The final terms are slightly
2003 Sep 17
3
3D plot/surface rotation
How do I rotate 3D plots/surfaces generated by either cloud or wireframe? Thanks. Marc Marc W. Zodet, MS Health Statistician Agency for Healthcare Research and Quality [[alternative HTML version deleted]]
2006 Aug 14
3
Making R script to run in a console
Hi, is possible to make a R script to run under a console without open the R environment? Something like this example.R #!/usr/bin/R function(name="Put here your name") { print(name) } In a console I make ./example.R name="Ronaldo Reis J?nior" then program print my name. It is possible? Thanks Ronaldo -- A jury consists of twelve persons chosen to decide who has the
2003 Nov 25
3
weighted mean
How do I go about generating a WEIGHTED mean (and standard error) of a variable (e.g., expenditures) for each level of a categorical variable (e.g., geographic region)? I'm looking for something comparable to PROC MEANS in SAS with both a class and weight statement. Thanks. Marc [[alternative HTML version deleted]]
2005 Feb 14
5
Sipura g729 call quality to PSTN
If this has been covered before - I appologize. We use some Sipura SPA-2000's with the g711 codec and all seems fine (except for the occasional failure to register errors in my asterisk logs - but I will save that for another post). g711 call quality is on par with our Cisco 7960's. However, when using the g729 codec, the call quality on the Sipura device goes downhill on the PSTN side
2009 Feb 26
9
Inefficiency of SAS Programming
If anyone wants to see a prime example of how inefficient it is to program in SAS, take a look at the SAS programs provided by the US Agency for Healthcare Research and Quality for risk adjusting and reporting for hospital outcomes at http://www.qualityindicators.ahrq.gov/software.htm . The PSSASP3.SAS program is a prime example. Look at how you do a vector product in the SAS macro
2010 Aug 18
1
svyquantile w/ svyby is returning an error
svymean w/ svyby is working for me... > svyby(~visitcnt, ~agegrp3.f, svymean, design=svydes) agegrp3.f visitcnt se.visitcnt 18-44 18-44 8.755552 0.4953235 45-64 45-64 10.131555 0.5347806 65+ 65+ 9.588802 0.4323629 svyquantile is working for me... > svyquantile(~visitcnt, quantiles=c(.25, .5, .75), ties="rounded", design=svydes) 0.25
2003 Jun 18
2
Forward stepwise procedure w/ stepAIC
I'm attempting to select a model using stepAIC. I want to use a forward selection procedure. I have specified a "scope" option, but must not be understanding how this works. My results indicate that the procedure begins and ends with the "full" model (i.e., all 17 independent variables)...not what I expected. Could someone please point out what I'm not
2003 Jun 06
4
Introductory Resources
>I am interested in R as an alternative for a statistical tool >at our firm. Ditto... I have recently moved to this agency from a company where I had access to Splus. There is also a coworker here who had used Splus at a previous employer. We both would like some access to the S language. We are considering either begging loud and long to try to get the agency to purchase two copies of
2009 Apr 29
1
Dynamic visualisation of R data using Adobe FLEX
Hi useRs, I had posted about Adobe FLEX talking to R for rich visualisation. Reply from Jeffery Horner contained links to the revolution-computing.com webpage which had information pertaining to the Bay Users R group Meetup on Web Dashboards with R. I have a very specific project that I need to implement. I wish to use the graphics capabilities provided by Adobe FLEX to visualise outputs from R.
2009 Aug 25
2
how to pass user input to a function?
Hi everyone, I'm building a website (http://yourpsyche.org) using Jeffrey Horner's awesome Rapache module. I want to take user input, and pass it to an R script. At first I was simply using if else statements, but after a while I had so many nested if else's in my code that my head was spinning. So then I started using cat() and source() to write temporary files and read them back in