search for: dob

Displaying 20 results from an estimated 72 matches for "dob".

Did you mean: do
2005 Dec 18
13
calculate age based on DoB
Hi, I wrote a little helper that calulates someone''s age based on his/her date of birth. def age(dob) diff = Date.today - dob age = (diff / 365.25).floor age.to_s end It works fine, but it''s not completely accurate as it just takes the average days in a year. It should be able to calculate this more accurately, right? I can''t work it out though.. Jeroen
2011 Nov 07
2
Problem working with dates
...n do all the things I need to in R before using it in my daily work. So far, I've managed to read in all my data and have done some data manipulation. I'm having trouble with fixing an error in a date variable though, and was hoping someone could help. One of the patients in my data has a DOB incorrectly entered as: '11/23/21931' Their DOB should be: '11/23/1931' How can I correct this problem before calculating age in the code below? DOB starts out as a factor in the Demo dataframe but then is converted into a date. So I had thought the ifelse that follows could be...
2006 Jan 22
23
calculate users age
i know it''s probably really simple, how do i work out someone''s age if i have their d.o.b. stored as a date in my db. cheers -- Posted via http://www.ruby-forum.com/.
2010 Feb 23
1
Problem with strptime generating missing values where none appear to exist
...R Helpers, I am having difficulty with strptime. I wish to find the differences between two vectors of times. I have apparently no difficulty to convert the vectors to the appropriate format using strptime. But, then difftime does not calculate all the differences. Here is the code and output:- dob=strptime(as.character(datx$BDT),'%d-%b-%y'); dob$year=dob$year-100 sdate=strptime(as.character(datx$SDT),'%d-%b-%y') head(dob); head(sdate) [1] "1922-07-14" "1922-07-14" "1922-07-14" "1922-07-14" "1921-03-23" "1921-03-23" [...
2006 Jan 25
0
Another crack at age calculations
I cobbled this together based on a few previous posts and some tinkering, nothing fancy (my first bit of Ruby infact) but it seams to work for my purposes. My questions is actually why can I call <%= h(child.age(child.dob)) %> in a view but not <%= h(child.age_year_month(child.dob)) %>? Both work fine in the console. Thanks for any insight, Hugh child.rb class Child < Person end person.rb class Person < ActiveRecord::Base def age(dob) unless dob.nil? years = Date.today.year - dob.yea...
2012 Jul 11
3
unable to subtract dates in R
Hi, I wanted to calculate the age of people in my dataset by subtracting the individual's date of birth from their intake into a program. After several hours, searches of help archives, and the downloading of lubiridate, I have had no luck with this. Below is the code I used. > intakeDS$DOB <- as.character(intakeDS$DOB) > intakeDS$DOB <- as.Date(intakeDS$DOB, "%Y%m%d") > > # Make IntakeDate a date variable, by first converting it from numeric to character then from character to date > #intakeDS$IntakeDate <- as.character(intakeDS$IntakeDate) > in...
2012 Oct 08
2
converting DOB format to age
Hi, I have a column of DOB in mm/dd/yyyy. I want to convert this format to age. Thanks a lot.   Best,Farnoosh Sheikhi [[alternative HTML version deleted]]
2010 Feb 23
0
subtracting 100 from strptime year vector generates missing values in POSIXct where none appear to exist in strptime year vector
...FORMATION BELOW >From: Don MacQueen [macq at llnl.gov] >Sent: 23 February 2010 21:25 >To: Jonathan Williams; r-help at r-project.org > >Subject: Re: [R] Problem with strptime generating missing values where none appear to exist > >What happens if you do all that NA checking on dob *before* subtracting 100 from dob$year? > >What happens if you use difftime() before subtracting the 100? > >Do you get any NAs if you convert dob to POSIXct? > >(these are just investigative ideas, obviously) > >-Don =======================================================...
2010 Dec 10
2
Remove 100 years from a date object
Hello, I have some data that has dates in the form 27.02.37. I convert them to a date object as follows: as.Date(data$date,format="%d.%m.%y") But this gives me years such as 2037 when I would like them to be 1937. I thought of trying to take off some time i.e. as.Date(camCD$DoB,format="%d.%m.%y") - 100*365 But that doesn't seem to work out correctly. Any ideas how to do this? Thanks Dan -- ************************************************************** Daniel Brewer, Ph.D. Institute of Cancer Research Molecular Carcinogenesis Email: daniel.brewer at icr....
2012 Nov 06
1
pivot table
Hello, I have a data which looks like below: Some of the patients have multiple diagnosis. ID(200 patients)   Diag (100 unique Diag-200 in general)   Proc (50 uniqe Proc)  DOB (200)   Gender (200)    a                           daig1 b                           diag2 c                            diag1 I want to reformat this data to : ID   diag1 diag 2 diag 3..  diagx   proc1   proc2   proc3... procx  DOB  Gender a1011  20F Thanks a lot for your help and time.   Best,...
2010 Aug 16
1
How can I read date format '02-Jan-02' ?
Hello, I am trying to read a database exported from SAS. It is form of csv, and the date format reads '02-Feb-99'. I used following code to convert character to date format, db$dob<-as.Date(db$dob, format="%d-%b-%y"). but it doesn't work, only seems NA. What's wrong with this code? Thank you in advance. Best, Dong-Hee Koh [[alternative HTML version deleted]]
2012 Sep 13
1
Parsing "back" to API strcuture
Dear R experts, I'm reading data from an online database via API and it gets delivered in this messy comma separated structure, > RAW.API <- structure("id,event_arm,name,dob,pushed_text,pushed_calc,complete\n\"01\",\"event_1_arm_1\",\"John\",\"1979-05-01\",\"\",\"\",2\n\"01\",\"event_2_arm_1\",\"John\",\"2012-09-02\",\"abc\",\"123\",1\n\"01\&quot...
2016 Jun 10
2
[RFC] LLVM Coroutines
On Fri, Jun 10, 2016 at 6:36 AM, Gor Nishanov <gornishanov at gmail.com> wrote: > >> If you're going down that route, that still leaves the question of the > >> semantics of the fork intrinsic... thinking about it a bit more, I think > >> you're going to run into problems with trying to keep around a return > block > >> through optimizations:
2006 Jun 13
0
date_select and date validation
Hi, I''ve put together a simple form that contains among other things a date_select: <%= date_select(:user, :dob, :order => [:day, :month, :year], :start_year => 1900, :end_year => Date.today.year) %> In my controller I have some code to create a user entity from the parameters posted up from the form, like so: parameters: {"user"=>{"dob(1i)"=>"2006", "do...
2001 Oct 15
0
date and chron library help...!
...rginal data is in SAS format. 3 columns of this dataset are supposed to be dates, but read.xport doesn't recognise them as dates (all columns are read in as mode numeric). So I load up the date library and go ahead to convert the 3 columns into dates. So doing ... > library(date) > s05962$DOB_as.date(s05962$DOB) > s05962$DOB # to check if everything is ok, and it is...dates have been correctly converted... However, when I look at the first 10 rows of the whole dataframe, > s05962[1:10,] # The column DOB is is still in numeric mode... So I try again, but the following occu...
2008 Aug 06
3
Help in running Stata dataset in R
...ta") > des() No. of observations = 670 Variable Class Description 1 scrno integer 2 todaydate Date 3 ethnic character 4 othtribe character 5 dob Date 6 ageyrs integer 7 agemths integer 8 sex character I cannot figure out what the problem is. Please help me. Kind regards, Lazarus Mramba Junior Statistician P.O Box 986,...
2003 Jun 30
1
date to age
I have files which have columns of data that look like this: DOB 9/27/1964 ... That is, dates in month/day/year format. When variables like DOB are read in, they are converted to factors. So, I wrote this to convert from date to age in years: age<-function(x) {as.numeric(Sys.time()-strptime(as.character(x),format="%m/%d/%Y"))/365.25} This isn...
2012 Jan 11
2
Checking dates for entry errors
...not in a standard unambiguous format ? In the former case, one could easily lose the date rather than recognizing it is in error and needs to be corrected. ? So my question is how best to check these sorts of date values. ? So far, I've been checking date values with things like: ? sort( unique(DOB) ) sort( unique(substr(DOB, 1, 4) ) ) sort( unique(substr(DOB, 6, 7) ) ) sort( unique(substr(DOB, 9, 10) ) ) ? These are good for seeing, say, year values that are clearly in error, but don't do much to catch the impossible date I cited above. ? How can I use R to better scrutinize my date data...
2024 Mar 26
1
core & cosine schema items in Samba AD DC user object?
...to update samba-tool to do this ;-) > > Maybe these attributes can be supplemented with some Windows tool > (RSAT/ ADUC), I haven't tried it yet. > > What I just tried - add these attributes to AD with ldbmodify and a > pre- prepared LDIF file (as: > > dn: CN=Pep?k,OU=dob??,OU=kamar?di,DC=ad,DC=hanzlici,DC=cz > changetype: modify > add: l > l: Plze? > > ) - and it works well, thus problem is solved. > > And another finding - adding a non-existent attribute such as > Locality-Name ( > > dn: CN=Pep?k,OU=dob??,OU=kamar?di,DC=ad,DC=hanzl...
2010 Feb 28
6
A slight trap in read.table/read.csv.
I had occasion recently to read in a one-line *.csv file that looked like: "CandidateName","NSN","Ethnicity","dob","gender" "Smith, Mary Jane",111222333,"E","2/25/1989","F" That "F" (for female) in the last field got transformed to FALSE. Apparently read.csv (and hence read.table) are inferring that if the entries of a file are all F's and...