Displaying 16 results from an estimated 16 matches for "sampledata".
2012 Oct 04
1
R help - Adding a column in a data frame with multiple conditions
Hi,
I am trying to add a column of numbers to a data frame in R with multiple
conditions.
Here is a simplified example df:
[A] [B] [C] [D] [E]
[1] 1 X 90 88
[2] 1 Y 72 70
[3] 1 Z 67 41
[4] 2 X 74 49
[5] 2 Y 42 50
[6] 2 Z 81 56
[7] 3 X 92 59
[8] 3 Y 94 80
[9] 3 Z 80 82
I would like column [E] to have a certain value (found either in [C] or
[D]) based on conditions in columns [A] *and* [B].
2011 Jun 17
4
profile plot in R
Hi friends,
I have a matrix with following format.
group var1 var2 .......varN
c1 group1 1.2399 1.4990....-1.4829
c2 group4 0.8989 0.7849.....1.8933
...
...
c100 group10 .....
I want to draw a profile plot
of each condition c1 to c100, which rows in above matrix and each line
representing a row should be uniquely colored according to the group(1
to 10).
I think this is simple task
2009 Dec 31
4
Obtaining partial output from a function that does not run to completion.
...the output from either the lm() or vf() even thought neither lm() nor vif() have any problems . How can I force the function to print sequential results rather than wait for the entire function to complete before listing the functhion's output?
Thanks,
John
minBMI<-function(SS,SimData)
{
SampleData<-sample(1:SS,size=SS,replace=TRUE)
fitBMIEpiRevlm<-lm(AAMTCARE~BMIEpiRevAdjc+BMIEpiRevAdjcSq+SEX+jPHI+jMEDICAID+H_AGE+jMARSTAT+factor(jEDUCATION)+factor(jsmokercat)+factor(jrace)+log(INCOME_C+1),data=SimData[SampleData,],x=TRUE)
print(summary(fitBMIEpiRevlm))
print(vif(fitBMIEpiRevlm))
fitBMI...
2013 Jun 06
2
generating a bar chart with two axis for co-linear variable
...late the frequency for the listed variables and not the frequency percentage. Is there a method or a script with which I can pass the frequency percent and the related values as category columns for x axis?
I will attach the graphs that I have generated so that you can suggest the better way.
Sampledata - Sampledata.txt
What my function does to calculate the frequency with category names in X axis - 1.png
My requirement is to generate percentage frequency of the variable in y1 and not the frequency itself. 2.png (where x categories are missing)
Thanks,
Sudha Krishnan
-------------- next...
2006 Dec 07
2
How to use read.xls in R
Hello there,
In gdata package, read.xls is to be used for reading excel data (from
windows).
The following is my code:('C:/session/sampledata.xls' is where the file
is stored)
data1<-read.xls('C:/session/sampledata.xls',sheet=1)
and I got the following error message:
Error in system(cmd, intern = !verbose) : perl not found
Could you please tell me what I have done wrong and how I should do it?
Thanks a lot
Lisa Wang...
2009 Jul 27
2
How should i change the SAS Codes into R Codes?
...task. The SAS codes are as follows,
/*to generate the dataset*/
DATA Single_Simulation;
DO se=0 to 1 by 0.01;
DO sp=0 to 1 by 0.01;
DO DR=0 to 1 by 0.01;
TR=(DR+sp-1)/(se+sp-1+1.0e-12);
Adjust_Factor=TR/(DR+1.0e-12);
OUTPUT;
END;
END;
END;
RUN;
/*to select some data*/
DATA sampledata;
SET Single_Simulation;
IF DR=0.02 & sp=1;
RUN;
#I tried the following codes with R,failed
num<-seq(0, 1, by = 0.01)
for (se in num) {
for (sp in num) {
for (DR in num) {
TR=(DR+sp-1)/(se+sp-1+1.0e-12)
Adjust_Factor=TR/(DR+1.0e-12)
}
}
}
My questions are,
1. What is the co...
2009 Aug 12
0
Problem with Linux x86_64 RODBC and Netezza (PR#13889)
...= 3
write(1, "QueryTimeout=200000", 19) = 19
write(1, "\n ", 3) = 3
write(1, "DateFormat=1", 12) = 12
write(1, "\n", 1) = 1
write(1, "> ", 2) = 2
write(1, "SampleData = sqlQuery(conn, \"sel"..., 78) = 78
write(1, "+ ", 2) = 2
write(1, "\n", 1) = 1
write(1, "+ ", 2) = 2
write(1, " TB_CH_CBSA_CODE_CBSA"..., 46) = 46
write(1, "+ "...
2010 Jan 02
1
Help with tryCatch
...est code follows. Any suggestions for corrections would be appreciated.
# Define matrix to hold results
coeffs <- matrix(nrow=10, ncol=3)
dimnames(coeffs) < -list(NULL,c("BMI","BMIsq","min"))
# set row counter
n<-0
# Function to run
testone<-function()
{
SampleData<-sample(1:SS,size=SS,replace=TRUE)
result<-summary(glm(AAMTCARE~BMIEpiRevAdjc+BMIEpiRevAdjcSq+SEX+jPHI+jMEDICAID+H_AGE+jMARSTAT+factor(jEDUCATION)+factor(jsmokercat)+factor(jrace)+log(INCOME_C+1),data=SimData[SampleData,],family=Gamma(link="log")))
}
# if function ran correctly, in...
2003 Jun 25
1
Help on using read.table with files containing dates
...le to figure out some of the options,
e.g., colNames).
Here is a specific example of what I mean and what the problems are. An
First I load a sample data file whose first column is a date. This gives
the wrong answer as we shall see:
> library(date)
> sampData <- read.table("sampleData.csv",sep=",",header=TRUE)
> sampData
Date Col1 Col2 Col3
1 1/1/2003 1.2 1.4 0.160
2 1/4/2003 1.8 1.2 0.900
3 1/5/2003 0.9 1.1 -0.003
> mode(sampData$Date)
[1] "numeric"
>
Note that the Date column is coerced incorrectly into being numeric. Right...
2009 Nov 25
2
Grouped Barplot
...LLOWING LINK:
http://www.imachordata.com/wp-content/uploads/2009/09/boxplot.png
Sample data is attached -- there are 9 years and 5 cities. In my case I'm
looking to plot "Year" on x-axis and grouping boxplots by "City". I tried
the following code.
foo<-read.table("SampleData.csv", sep=",", header=TRUE)
attach(foo)
boxplot(Admit ~ City + Year, range=0.5, col=2:6) # its not solving the
purpose
I need some help with:
1) Plotting only 9 labels on x-axis (1996-2004).
2) For each "Year", I need to plot FIVE boxplots -- one for each "City"....
2002 Jul 12
2
Lattice help (again?)
...Here is the code:
my.panelconstr = function(x,y,...){
points(x,y)
panel.loess(x,y,span=1)
panel.superpose(x,y,...)
}
subset(m1data,! is.na(votms) & !is.na(age) & !is.na(Cplace) &
!is.na(tokentype)& !is.na(voicing),
select=c(votms,age,Cplace,tokentype,voicing)) -> sampledata
xyplot(votms ~ age | Cplace +
tokentype,data=datasample,xlab="Subject Age (months)",ylab="Voice
Onset Time (ms)",panel="my.panelconstr",groups=voicing)
Some information on the data set:
> sapply(sampledata,levels)
> $votms
> NULL
>
> $age
&...
2012 Oct 23
1
Creating a polygon from an unordered set of points
...ordered as a polygon and hence trying to draw it creates a series of lines
all over the place. I would like to turn the points into a ordered set that
results in a smooth polygon.
I have tried a "nearest point" approach. An example is shown here:
http://www.deepcreekanswers.com/samples/sampledata.png.
I've tried a closest perpendicular distance to the shoreline polygon
elements approach. But it's worse.
Does anyone have an approach that might work?
Thank you a priori.
Pete Versteegen
--
View this message in context: http://r.789695.n4.nabble.com/Creating-a-polygon-from-an-un...
2007 Jun 25
7
R-excel
Good morning to everybody,
I have a problem : how can I import excel files in R???
thank you very much
Dr.sa. Erika Frigo
Università degli Studi di Milano
Facoltà di Medicina Veterinaria
Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza Alimentare (VSA)
Via Grasselli, 7
20137 Milano
Tel. 02/50318515
Fax 02/50318501
[[alternative HTML version deleted]]
2010 Mar 10
3
see the example and help me
sample report data that i want to forecast
quarter quarter_index Revenue
2007 Q1 1 $3,856,799
2007 Q2 2 $4,243,328
2007 Q3 3 $4,930,369
2007 Q4 4 $5,443,579
2008 Q1 5 $5,164,830
2008 Q2 6 $5,104,413
2008 Q3 7
2012 Oct 31
2
Aggregate Table Data into Cell Frequencies
...wever I would like to
have the temp variables *aggregated into single rows* so that I have the
frequency ("Freq" | counts) of each time each "delayValue" occurs in the
cells.
I've tried this command without luck, it seems to be dropping a bunch of
values.
tmp <- reshape(sampleData, direction = "wide",timevar = "delayValue",
new.row.names = unique(sampleData$id) )
structure(list(delayValue = c("0", NA, "7", "8", "9", "10", NA,
NA, "4", "5", "6", "7", "8",...
2013 Jul 19
1
Problem with distributing data in package.
Hi List,
I am building a package for a client to help them create and perform
analyses against netcdf files which contain 'a temporal stack' of
grids.
For my examples and test cases, I create an example dataset in code
(as this is a lot more space efficient than providing raw data). The
code creates a netcdf file in tempdir() and an object of class 'ncdf'
in the global namespace.