Displaying 20 results from an estimated 3000 matches similar to: "Missing Data and applying"
2008 Jun 20
2
Problems with basic loop
I'm having trouble creating a looping variable and i can't see wher ethe
problem arises from any hep gratfully appreciated
First create a table
x<-table(SURVEY$n_0,exposed)
> x
exposed
False True
Under 16 24 1
16-19 68 9
20-24 190 37
25-34 555 204
35-44 330 87
45-54 198 65
55-64 67 35
65+
2008 Jun 06
2
Merging two dataframes
Hi All,
Newbie question for you all but i have been looking at the archieves and the
help dtuff to get a rough idea of what i want to do
I would like to merge two dataframes together based on a keyed variable in
one dataframe linking to the other dataframe. Only some of the cases will
match but i would like to keep the others as well.
My dataframes have 67 and 28 cases respectively and i would
2008 Jun 17
2
Calling functions
Another newbie question.
I've written a function and saved the file as Xtabs.R, in a central place on
a network so others will be able ot use the function,
My question is how do i call this function?
I've tried to chance the working directory, and tried to load it via;
> library(Xtabs, lib.loc="//filer/common/technical/surveys/R_test")
but neither seem to work? the function
2008 Dec 05
1
Loop swith String replacement
Hi All,
I'm trying to split my dataset, into multiple datasets that i'll analyse
later, i wanted to do this dynamically as i might need to rerun the code
later.
I was looking at doing this via a loop, (Are other methods more appropriate?
Would a function be better?)
However i'm not sure in R how do do string replacement within the loop in
order to create unique dataset names based on
2009 Aug 25
1
Help with nls and error messages singular gradient
Hi All,
I'm trying to run nls on the data from the study by Marske (Biochemical
Oxygen Demand Interpretation Using Sum of Squares Surface. M.S. thesis,
University of Wisconsin, Madison, 1967) and was reported in Bates and Watts
(1988).
Data is as follows, (stored as mydata)
time bod
1 1 0.47
2 2 0.74
3 3 1.17
4 4 1.42
5 5 1.60
6 7 1.84
7 9 2.19
8 11 2.17
I then
2009 Sep 15
2
Viewing Function Code
Hi All,
I'd like to see the function code behind the barplots2() function in the
gplots package, however i come across a bit of a stumbling block of a hidden
function, can anyone help?
> library(gplots)
> methods(barplot2)
[1] barplot2.default*
Non-visible functions are asterisked
> barplot2
function (height, ...)
UseMethod("barplot2")
<environment:
2008 Dec 31
3
Paste in a FOR loop
Hi All,
I've been having a little trouble using R2HTML and a loop, but can't figure
out where the problem lies, any hints gratefully received.
My code at the minute, (Which does work) is in the following:
library(R2HTML)
HTMLStart(outdir =
file.path("C://Example_work","R_projects","Dynamic_creative"),filename =
"RMDC_mockup",Title="Mock up for
2008 Aug 05
2
Selecting Variables
Hi All,
i have a dataset that i want to dynamically inspect for the number of
variables that start with "Exposure_" and then for these count the entries
across each case i.e
ID Exposure_1 Exposure_2 Exposure_3
1 y y y
2 y y -
3 y - -
So the corresponding new variables
2010 Sep 08
11
problem with outer
Hello,
i wrote this function guete and now i want to plot it: but i get this error
message. i hope someone can help me.
Error in dim(robj) <- c(dX, dY) :
dims [product 16] do not match the length of object [1]
p_11=seq(0,0.3,0.1)
p_12=seq(0.1,0.4,0.1)
guete = function(p_11,p_12) {
set.seed(1000)
S_vek=matrix(0,nrow=N,ncol=1)
for(i in 1:N) {
X_0=rmultinom(q-1,size=1,prob=p_0)
2008 Oct 13
2
Timestamps and manipulations
Hi All,
I've a couple of questions i've been struggling with using the time
features, can anyone help? sample data
Timestamp user_id
27/05/08 22:57 763830873067 27/05/08 23:00 763830873067 27/05/08 23:01
763830873067 27/05/08 23:01 763830873067 05/06/08 11:34 763830873067
29/05/08
23:08 765253440317 29/05/08 23:06 765253440317 29/05/08 22:52
765253440317
2009 Oct 12
1
List mappings and variable creation
Hi All,
I have a questions about associative list mappings in R, and if they are
possible?
I have data in the form show below, and want to make a new 'bucket' variable
called combined. Which is the sum of the control and the exposed metric
values
This combined variable is a many to many matching as values only appear in
the file if they have a value > 0.
conversion.type filteredID
2008 Oct 15
1
comparing with lead function
Hi All,
I've been trying to compare if the previous value in a variable is equal to
a binary value..(i.e i want to check if the last event was a yes or no)
i've been trying to write some code for this, but it seems overly elaborate,
can anyone suggest a better / shorter / neater way?
The below doesn't quite work but shows my idea of splitting by the factor
id, then creating a new
2009 Mar 11
1
Forecasting with dlm
Hi All,
I have a problem trying to forecast using the dlm package, can anyone offer
any advise?
I setup my problem as follows, (following the manual as much as possible)
data for example to run code
CostUSD <- c(27.24031,32.97051, 38.72474, 22.78394, 28.58938, 49.85973,
42.93949, 35.92468)
library(dlm)
buildFun <- function(x) {
dlmModPoly(1, dV = exp(x[1]), dW = exp(x[2]))
}
fit <-
2008 Sep 23
2
Contional
Hi All,
I'm having trouble selecting rows to delete, that i can't seem to overcome.
Below is some sample data, i am trying to dedup the data based on each user,
and simultaneously the timestamp (at the side i have highlighted expected
row to be removed)
I've looked at the lag function but can't seem to make it work?
My logic ran along the lines of an ifelse statement and then
2005 Dec 26
1
grouping-R-help
Hello R-experts,
I have a set of data as follows:
age time
1 28 1
2 53 2
3 53 3
4 36 4
5 54 4
6 46 4
7 45 5
8 31 6
9 53 7
10 35 7
11 62 8
12 19 8
13 43 2
14 51 3
15 45 0
16 48 2
17 49 3
18 57 2
19 45 3
20 27 10
21 33 12
22 29 14
23 46 16
24 45 19
25 43 2
26 28 6
27 50 7
28 28 4
2010 Jan 22
1
Title splitting function
Hi All,
I'm trying to write a function to automatically split long strings so they
will appear nicely in a chart i'm trying to create,
Say i have a string
title <- "some variety of words that are descriptive"
In this instance i want to place carriage return where there is a space just
prior to a specified number of characters (in this case 15)
title.length <-
2007 Apr 23
3
getElementsBySelector problem in IE
I''m having this problem with IE and getElementsBySelector, but am a
relative js novice, so quite possible -- likely even -- that I''m doing
something stupid. Either way, a fresh pair of eyes would help.
Basically I''m duplicating a fieldset within a form (so you can upload
more than one photo). [BTW, the fieldsets have a CSS id which relates
to the object id of the
2006 Dec 13
2
persp() problem
Dear list,
I have a problem on persp()
x <- u1data #first coloum in attached data
y <- u2data #second coloum in attached data
f <- function(x,y){qgev(pnorm(rhoF*qnorm(pnorm((qnorm(y)-rho2*qnorm(x)/sqrt(1-rho2^2))))
+sqrt(1-rhoF^2)*qnorm(0.95)),-0.3935119, 0.4227890,
0.2701648)}
z <- outer(x,y,f)
persp(x,y,z)
The R will display:
"Error in persp.default(x, y,
2011 Dec 23
2
missing value where TRUE/FALSE needed
Merry Xmas to all,
I am writing a function and curiously this runs sometimes on one data set
and fails on another and i cannot figure out why.
Any help much appreciated.
If i run the code below with
data <- iris[ ,1:4]
The code runs fine, but if i run on a large dataset i get the following
error (showing data structures as matrix is large)
> str(cluster.data)
num [1:9985, 1:811] 0 0 0 0
2011 Jun 23
2
Loading List data into R with scan()
Hi All,
I've been given a data file of the form:
1: 3,4,5,6
2:1,2,3
43: 5,7,8,9,5
and i want to read this data in as a list to create the form:
(guessing final look)
my.list
[[1]]
[1] 3 4 5 6
[[2]]
[1] 1 2 3
[[43]]
[1] 5 7 8 9 5
I can get to a stage using scan:
scan("my.data", what = character(0), quiet = TRUE)
to load
[1] "1: 3,4,5,6"
[2] "2:1,2,3"
[3]