Displaying 20 results from an estimated 1000 matches similar to: "matrix question"
2008 Aug 20
2
Line of best
Hi,
I have a scatter plot, with an equation that best fits the scatter plot expressed as: 1/x^.6. I know for normal linear regression lines you can use the abline() command; however, since my best fit line is not linear, how can I draw my line on the scatter plot in a similar fashion to abline().
Thanks for everyone's help again. I appreciate this board's advice.
Mark
2008 Aug 13
3
Conditional statement used in sapply()
Hi,
I have data stored in a list that I would like to aggregate and perform some basic stats. However, I would like to apply conditional statements so that not all the data are used. Basically, I want to get a specific variable, do some basic functions (such as a mean), but only get the data in each element's data that match the condition. The code I used is below:
>
2010 Feb 01
2
Loading data from folder
Hi,
I am trying to load csv type data from a folder. However, rather than
syntax that simply loads one file at a time I was wondering if there
is a method that loads all data from a specific folder.
For instance, I have the following data files in a folder nebraskaStats:
10-1-2009_10-7-2009.txt
10-2-2009_10-8-2009.txt
10-3-2009_10-9-2009.txt
....etc. (245 total files in folder)
Each file
2010 Feb 01
2
Merging vector data into one file
Hi,
I had another question. If you had say a vector (e.g., called data)
with 235 elements and each element looked like the following
data[[1]]
Column A-B Column Z-S Column A-S....
1 2 5 .......
data[[2]]
Column Z-B Column A-S Column A-B....
2 1 3 .......
Anyway, each element consists of one row
2008 Aug 12
2
Parsing array data
Hi,
I read in csv files with the following code:
res <- vector(mode="list",length=3)
for(i in 1: length(res))
res[[i]]<-read.csv(file=paste("/Users/markaltaweel/Desktop/Output/HydroDataOutput",i,".csv",sep=""),header=T,sep=",")
This allows me to load the data into an array of length 3, with the res array containing my data from the csv
2009 May 01
1
question on aggregate
Hi,
I am trying to sum column information in a list with 3 instances.
For example:
ID Traversed ID Traversed ID Traversed
1 5 1 7 1 8
2 8 2 11 2 7
3 11 3 22 3 16
What I want to do is sum the
2003 Apr 14
3
strange connection attempts
hello,
I have turned on sysctls variables:
net.inet.tcp.log_in_vain: 1
net.inet.udp.log_in_vain: 1
And i have plenty of strange connection attempts on udp protocol
Connection attempt to UDP xx.xx.x.xxx:55414 from 192.43.172.34:53
Apr 13 23:56:53 pals /kernel: Connection attempt to UDP xx.xx.x.xxx:55414 from 192.43.172.34:53
Connection attempt to UDP
2012 Oct 17
4
function logit() vs logistic regression
Hello!
When I am analyzing proportion data, I usually apply logistic regression
using a glm model with binomial family. For example:
m <- glm( cbind("not realized", "realized") ~ v1 + v2 , family="binomial")
However, sometimes I don't have the number of cases (realized, not
realized), but only the proportion and thus cannot compute the binomial
model. I just
2009 Mar 20
2
plotting two variables with a third used for color
I have a problem where I have two columns of data that I can simply plot using:
plot(wV[0:15,3],wY[0:15,3]).
This produces my desired plot.
Now, say I have a third variable that I would like to introduce and use that variable to set different colors in the plot
In this case, say I wanted values greater than 0 to be "blue" and values less than 0 to be "red"
Basically, my
2024 Jan 14
1
Strange results : bootrstrp CIs
Well, this would seem to work:
e <- data.frame(Score = Score
, Country = factor(Country)
, Time = Time)
ncountry <- nlevels(e$Country)
func= function(dat,idx) {
if(length(unique(dat[idx,'Country'])) < ncountry) NA
else coef(lm(Score~ Time + Country,data = dat[idx,]))
}
B <- boot(e, func, R=1000)
boot.ci(B, index=2, type="perc")
2012 Sep 27
3
Calculating number of elapsed days from starting date
Hi
I have data for events in rows, with columns for person and date. Each
person may have more than one event;
tC <- textConnection("
Person date
bob 1/1/00
bob 1/2/00
bob 1/3/00
dave 1/7/00
dave 1/8/00
dave 1/10/00
kevin 1/2/00
kevin 1/3/00
kevin 1/4/00
")
data <- read.table(header=TRUE, tC)
close.connection(tC)
rm(tC)
I would like to add a new column to my dataframe containing
2009 Mar 20
2
functions within a list
Hi,
I am trying to perform various functions on a list with a number of elements. For example. I would like to take the mean of different variable values in the entire list. As an example,
say I have a list with 1000 elements and variables called Id and Tick. What I would like to do is take the mean of a variable called X for each Tick in the data element. So, there can be say 1 to 600 tick
2008 Aug 19
2
conditional with and operators
Hi,
I have a problem in which I am parsing data from a list. I am simply trying to return data that has several conditions being true. Here is my syntax below:
d<-sapply(res,function(.df){(.df$TimesVisited[.df$Tick>912 && .df$Id>0])}) #res is the list, and I am trying to return a result that has two true conditions (that is the variable Tick should be greate than 912 and Id
2008 Aug 21
1
Kruskal.test() on lists
Hi,
I am trying to do a kruskal wallis test on two lists, fVisited and cSN:
fVisited[[1]]
[1] 0.17097623 0.30376141 0.17577266 0.14951855 0.03959753 0.08096217 0.05744888 0.02196257....
....
cSN[[1]]
[1] 0.08557303 0.36477791 0.19601252 0.12981040 0.05351320 0.10385542 0.03539577 0.03106175....
So if I just want to do a test on just one of the entries this is simple enough:
2013 May 03
2
Find the flow data from its accumulation of the panel data
Hi,
I have the panel data of income statement of several banks. The date
9803 means 1998-Q1, 9806 means 1998-Q2, etc. I transform the date code to 1
(for 1998Q1), 2 (for 1998Q2), ...., 16 (for 2011Q4) where 1, 2, .... are
placed in Col1.
Now the income statement of a specific quarter is actually the
accumulation from the beginning of the year. For example, the cost data of
1999Q3 is the
2011 May 05
1
Question about error of "non-numeric argument to binary operator"
I have been trying to do a nls model and gives me the error of a nonnumeric
argument
table(file="c:/tt2.txt",header=T)
> fit.model <- nls(TT~60*(1+alpha*(v/c)^beta),data=tt2, start=list(alpha=1,
beta=3, v=1000))
Error in v/c : non-numeric argument to binary operator
> is.numeric(tt2)
[1] FALSE
> is.character(tt2)
[1] FALSE
> as.numeric(tt2)
Error: (list)
2009 Aug 16
5
Plot(x,y)
Hi ,
I am using the plot function for some data , and the plot is coming back
pure black , with scales on the side .
Regards
Malcolm
[[alternative HTML version deleted]]
2005 Dec 20
2
Extracting data from .zip file in WINDOWS version of package
Hello,
I am building a R-package for Genetics analysis. The accepted data is in pedigree (.ped) file format.
To load the data (say CAMP.ped) from "data" directory, I have a function "CAMP.R", which does the job.
The package builds successfully in Linux (.tar.gz) and the data loads successfully by "data(CAMP)".
However, when I build the package in WINDOWS, the data
2010 Jan 11
3
interpolation
Dear R-users,
I have a complex line by xy-values (ordered by z).
And I would like to get interpolated y-values on the positions of x = 0:600.
How do I get the correct points?
x=c(790,790,790,790,790,786,783,778,778,766,763,761,761,761,715,628,521,350,160,134,134,129,108,101,93,111,161,249,288,243,139,45,7)
2006 Aug 03
2
NLME: Problem with plotting ranef vs a factor
Hi
I am following the model building strategy that is outlined in the Pinheiro and Bates book wrt including covariates but am having a problem with the plot. Basically I am using 4 covariates (1 of them is continuous) and 3 of them are fine but the 4th one is being shown as a scatterplot despite the fact that it is a factor. I have explicitly declared this to be a factor (pcat<-as.factor(pcat))