Clinical and cost effectiveness of computer treatment for aphasia post stroke (Big CACTUS): study protocol for a randomised controlled trial
School of Health and Related Research, University of Sheffield, 107 Innovation Centre, 217 Portobello, Sheffield S1 4DP, England
Nursing, Midwifery and Allied Health Professions Research Unit, Glasgow Caledonian University, Cowcaddens Road, Glasgow G40BA, England
Medical Statistics Group, School of Health and Related Research, University of Sheffield, Regent Court, Regent Street, Sheffield S1 4DA, England
Reader, School of Psychological Sciences, University of Manchester (MAHSC), Joint theme lead - Patient-Centred Care, NIHR CLAHRC Greater Manchester, Centre for Stroke and Vascular Research, CSB, Salford Royal NHS Foundation Trust, Stott Lane, Salford M6 8HD, England
Senior Research Fellow in Health Economics, Health Economics and Decision Science, ScHARR, University of Sheffield, Regent Court, 30 Regent Street, Sheffield S1 4DA, England
Aphasia affects the ability to speak, comprehend spoken language, read and write. One third of stroke survivors experience aphasia. Evidence suggests that aphasia can continue to improve after the first few months with intensive speech and language therapy, which is frequently beyond what resources allow. The development of computer software for language practice provides an opportunity for self-managed therapy. This pragmatic randomised controlled trial will investigate the clinical and cost effectiveness of a computerised approach to long-term aphasia therapy post stroke.
A total of 285 adults with aphasia at least four months post stroke will be randomly allocated to either usual care, computerised intervention in addition to usual care or attention and activity control in addition to usual care. Those in the intervention group will receive six months of self-managed word finding practice on their home computer with monthly face-to-face support from a volunteer/assistant. Those in the attention control group will receive puzzle activities, supplemented by monthly telephone calls.
 Outcome measures will be made at baseline, six, nine and 12 months after randomisation by blinded speech and language therapist assessors. Primary outcomes are the change in number of words (of personal relevance) named correctly at six months and improvement in functional conversation. Primary outcomes will be analysed using a Hochberg testing procedure. Significance will be declared if differences in both word retrieval and functional conversation at six months are significant at the 5% level, or if either comparison is significant at 2.5%. A cost utility analysis will be undertaken from the NHS and personal social service perspective. Differences between costs and quality-adjusted life years in the three groups will be described and the incremental cost effectiveness ratio will be calculated. Treatment fidelity will be monitored.
This is the first fully powered trial of the clinical and cost effectiveness of computerised aphasia therapy. Specific challenges in designing the protocol are considered.
Registered with Current Controlled Trials ISRCTN68798818 on 18 February 2014.
Stroke is the largest cause of disability in the United Kingdom with communication impairment affecting one third of survivors 1 . Aphasia is the most common communication impairment acquired post stroke. It is a disorder of language which may affect understanding, expression, reading and writing. Speech and language therapy (SLT) is often received regularly initially but rarely continues after the first few months. Medical instability, fatigue and confusion may reduce full engagement with language therapy in the early weeks post stroke, reducing the opportunity for people to participate in treatment. There is evidence that people can continue to improve their language skills for several years 2 . As the consequences of aphasia remain a problem long term, investigation of interventions to reduce this health burden in the chronic stages post stroke is crucial. The National Stroke Strategy 1 recommends people receive rehabilitation for as long as they benefit from it. Treatment of aphasia that persists beyond the first few months post stroke is often not available through NHS services in the United Kingdom as ongoing therapy is costly through face-to-face SLT and places greater demands on limited resources.
Meta-analysis in a Cochrane review 2 of SLT for aphasia following stroke suggests some effectiveness of aphasia therapy 2 . Adequately powered randomized controlled trials (RCTs) in this field are rare except for recent studies of SLT intervention in the first few weeks post stroke. Laska et al. 3 randomised 123 patients with aphasia to receive 45 minutes of SLT a day for 21 days, starting within two days of stroke onset, or no SLT intervention. Severity of the aphasia was not reduced. A recently completed study, ACT NoW 4 , randomised 170 people in hospital post stroke to SLT intervention or attention control (informal conversation with paid visitors) for up to four months. No significant differences between groups were shown and the authors suggested that the intervention may have been provided too early in the stroke pathway. As aphasia persists for many stroke survivors, therapy in the longer term also warrants investigation using adequately powered RCTs. Although rapid spontaneous recovery may occur in the first few months, there is preliminary evidence to suggest targeted and intensive SLT treatments can promote further improvement in the latter months 5 - 7 .
Targeted therapies with good preliminary evidence to date include constraint induced aphasia therapy (CIAT); use of language in games to make, reject or clarify requests for targeted items for 30 hours over 2 weeks 5 , 8 , 9 . A systematic review of 10 studies conducted over the decade concluded that evidence for this technique is favourable 10 . Model oriented aphasia therapy (MOAT), which tailors treatment according to a patient’s individual symptoms, was found to be comparable to CIAT when delivered with similar intensity 11 . Raymer et al. found personal relevance or ‘salience’ of the language material being practiced to be important when targeting therapy 6 . While the optimum intensity remains unclear, it is generally acknowledged that for stroke rehabilitation regular, repetitive therapy practice is a factor in treatment success.
The resources required to achieve intensive therapy in the long term is prohibitive in the current financial climate and lower cost options for the support of repetitive intensive practice are needed. Non-speech and language therapy professionals have been employed successfully to support therapy activity 4 , 12 , 13 .
Computer therapy, developed for the treatment of aphasia, has been reported to be useful in the provision of targeted language practice and provides opportunities for independent home practice as part of a self-management approach to maximise practice intensity, improving outcomes for reading, spelling and expressive language 13 - 17 . The Department of Health report, ‘ Our Health, Our Care, Our Say’ 18 , recommends self-management for long term conditions supported through technological innovation 18 . However, to date, studies of self-managed computer therapy for aphasia have been limited to descriptive case series with only three reported RCTs; two for treatment of reading disorders and one for treatment of word finding 13 , 14 , 19 . Although these studies were not fully powered, they indicate potential effectiveness of computer therapy. Such computer-based services for long term management of aphasia therapy could provide a low cost therapy option which is acceptable to patients and families. However, the actual cost effectiveness has not been definitively tested.
The StepbyStep© computerised approach to long term aphasia therapy combines current evidence underpinning language therapy with practical considerations of treatment delivery. Skills of a qualified speech and language therapist are used to select individually targeted therapy exercises, computer software is provided for regular self-managed practice of therapy exercises and volunteers or assistant SLTs support language practice and computer use 20 . A pilot study evaluating this approach was carried out with 34 people with persistent aphasia. They were randomly assigned to using computer software designed for treating aphasia, or usual long term care (most frequently this was social support). On average people with aphasia practiced their speech exercises on the computer independently for 25 hours over five months. The therapy showed statistically significant improvement in the ability to use spoken words when compared to usual care ( P = 0.014). The results indicated that self-managed computer therapy supported by volunteers (a total of four hours on average) could help people with aphasia to continue to practise, improving their vocabulary and confidence talking 13 . Patients and carers found it an acceptable alternative to face-to-face therapy 21 . Self-managed computer therapy could therefore improve the quality of life of people with persistent aphasia at relatively low cost, and exploratory economic analysis has suggested considerable potential for the intervention to prove cost effective 13 , 22 .
The aim of this study is to provide definitive evidence of the clinical and cost effectiveness of targeted, intensive speech and language impairment-based therapy intervention for word finding delivered through self-managed computer exercise for persisting post-stroke aphasia. This builds on the pilot RCT which explored possible effects, and informed measures, feasibility, recruitment rates, adherence, cost effectiveness analysis and a power calculation. The current study was commissioned by the United Kingdom National Institute for Health Research, having considered the limitations in the current evidence base.
The primary objectives of the study are:
1. To establish whether self-managed computerised speech and language therapy for aphasia related word finding problems after stroke increases the ability to use vocabulary of personal importance (impairment).
2. To establish whether self-managed computerised speech and language therapy for word finding problems after stroke improves functional communication ability in conversation (activity).
3. To investigate whether patients receiving self-managed computerised speech and language therapy perceive greater changes in social participation and quality of life (participation).
4. To establish whether self-managed computerised speech and language therapy is cost effective for persistent aphasia post stroke.
5. To identify whether any effects of the intervention are evident 12 months after therapy has begun.
Secondary objectives include investigating the generalisation of treatment to retrieval of untreated words (impairment); the use of treated words in conversation; the carer perception of communication effectiveness (participation) and identification of any possible adverse events. Carers’ own quality of life will be measured. Fidelity to treatment will also be monitored.
The study will use a pragmatic, parallel group randomised controlled adjunct trial design. The intervention under test or attention control will be delivered in addition to usual care. Outcomes will be compared for people who are four months or more post stroke, with persistent aphasia who are randomly allocated to either: usual care, self-managed computerised speech and language therapy in addition to usual care or attention control in addition to usual care.
Each participant will be in the trial for 12 months. Participants will be identified and recruited over an 18-month period in total, and 15 months at each site. Each participant will receive their intervention for six months, with follow-up at six, nine and 12 months. The study has an internal pilot phase with criteria for progression to completion of the full RCT. There are no formal statistical criteria for stopping the trial early. Decisions to stop the trial early on grounds of safety or futility will be made by independent data management and ethics committee members. The protocol conforms to the Consolidated Standards of Reporting Trials (CONSORT) guidelines for non-pharmacological studies (Figure
Figure 1
Progression of participants through the trial (CONSORT diagram).
Progression of participants through the trial (CONSORT diagram). SLT = speech and language therapist; ITT = intention to treat.
The study protocol was approved by Leeds West research ethics committee (reference number: 13/YH/0377). Additional approval was granted for Scotland by the Scotland A research ethics committee (reference number: 14/SS/0023). The University of Sheffield is the sponsor. The trial is registered with the International Standard Randomised Controlled Trials database ISRCTN (reference number: 68798818) and is commissioned by the National Institute for Health Research.
A total of 285 participants who have a diagnosis of aphasia as a consequence of a stroke will be recruited from approximately 20 speech and language therapy departments across the United Kingdom. The study will also be advertised at voluntary groups and using posters in libraries and GP surgeries in each locality so that potential participants can self-present to the local research team.
Participants will be included if they meet the following criteria:
1. Aged 18 or over;
2. Diagnosis of stroke(s);
3. Onset of stroke at least four months prior to randomisation;
4. Diagnosis of aphasia, subsequent to stroke, as confirmed by a trained speech and language therapist;
5. Ability to retrieve 10 to 90% of words on the Comprehensive Aphasia Test Naming Objects subtest (score of 5 to 43 out of 48);
6. Ability to perform a simple matching task in StepByStep with at least 50% accuracy (to confirm sufficient vision and cognitive ability) and
7. Ability to repeat at least 50% of words in a simple word repetition task in the StepByStep© program.
Participants will be excluded from the study if they meet any of the following criteria:
1. They have another pre-morbid speech and language disorder caused by a neurological deficit other than stroke (a formal diagnosis can be reported by the participant or relatives and confirmed by the recruiting speech and language therapist).
2. They require treatment for a language other than English (as the software is in English).
3. They are currently using the StepbyStep© computer programme or other computer speech therapy aimed at word retrieval and/or naming.
Potential participants will be contacted by the research speech and language therapist in each project centre and provided with information on the project. They will be contacted within a fortnight to establish whether they are interested in knowing more about the study. If they are interested, the research speech and language therapist will make an appointment to visit them at home. The number of those contacted but who cannot be followed up on or who are not interested in learning more and the reason for this will be recorded.
Eligibility will be established on the first visit. The speech and language therapist will request verbal consent to carry out the Naming Objects subtest of the Comprehensive Aphasia Test 24 . This test is used in routine practice and will establish the severity of the word finding deficit. If the word finding score is less than 10%, or greater than 90%, an explanation will be given that this type of computer therapy is not suitable for them. If the potential participant has eligible word finding scores, the research speech and language therapist will ask them to try a simple repetition task to confirm their repetition ability, followed by a matching task on the computer to confirm ability to see the screen and perform simple computer related actions.
The level of support required to enable a person with aphasia to provide informed consent is dependent upon the severity and profile of the aphasia. In order to provide information in a format consistent with each individual's language ability, a consent support tool (CST) will be used 25 . The research speech and language therapist at each site will request verbal consent from the potential participant to carry out part A of the CST. The result will indicate the style of information they are most likely to understand in part B. Participants will be given sufficient time to consider their participation before informed consent is taken by a research speech and language therapist. Participants providing their own informed consent will be provided with an aphasia-friendly consent form. If potential participants with severe aphasia indicate an interest, a relative (in Scotland this will be the person’s legal representative or nearest relative) will be asked to read an information sheet detailing their responsibility, and will be asked to sign a carer declaration on behalf of their relative with aphasia (in Scotland they will be asked to sign a consent form). For those participants with a carer, the carer will be asked if they are willing to complete some outcome measures related to their own quality of life and perception of their relative’s communication ability. They will be provided with the carer information sheet detailing their potential involvement and will be asked to sign a separate consent form. Informed consent will be obtained from each participant where they are able to give it, or consent or carer declaration will be obtained by the carer or legal representative where the participant is interested in participating, but is unable to provide their own fully informed consent.
Initial assessment will be performed by the local research speech and language therapist once informed consent has been given. This will include collection of the following demographic data: aphasia type, age, gender, time post-onset of stroke and type and location of stroke (if known). Baseline information will also include results of the standardised naming test - Naming Objects subtest of the Comprehensive Aphasia Test (performed as part of eligibility testing during screening) and the Comprehension of Spoken Sentences subtest of the CAT to provide information on the comprehension ability of the participants 24 . Baseline measures relating to the study outcomes are summarised in Table 1.
|
Outcome |
Measure |
Method of collection |
|
Change in word finding ability |
Naming of 100 personally relevant words |
Taken at baseline by blinded SLT recruiting participant 6, 9 and 12 months by separate blinded SLT. |
|
Change in functional communication |
10-minute videoed conversations structured around topics of personal interest. Activity scale of TOMS used to measure conversational ability |
Conversations at baseline by blinded SLT. Separate blinded SLT follows same topic guide at 6, 9 and 12 months. Videos randomised and rated centrally by blinded assessors. |
|
Change in patient perception of communication and quality of life |
COAST self-reported questionnaire. |
Administered by blinded SLT at baseline. Separate blinded SLT at 6, 9, and 12 months. |
|
Generalisation to untreated words |
Naming Objects subtest from Comprehensive Aphasia Test |
As above |
|
QALYs for cost effectiveness |
EQ-5D for patient and carer (accessible and by proxy) |
As above |
|
Carer quality of life |
Carer COAST and CarerQol |
Self-administered |
|
Cost of intervention |
Diaries of time spent on intervention |
Self-administered by SLTs, SLTAs and volunteers |
|
Cost of usual care |
Diaries of time spent on usual care |
SLT collects data from usual treating therapists and participants at baseline, 3, 6, 9 and 12 months |
|
Carer perception of change in communication |
Carer COAST |
Collected by blinded SLT at baseline. Separate blinded SLT at 6, 9, and 12 months. |
|
Negative effects of treatment |
Patient diary to record any difficulties and/or negative impacts of intervention |
Patients and carers - central team to send monthly letter reminding to send back in prepaid envelope. |
|
Intervention adherence |
Software tailoring checklists. Volunteer and/or assistant feedback forms. Software key files. Puzzle book and telephone support feedback. |
Completed by SLT, monitored by central study team. Self-managed practice monitored by central study team. Puzzle book completion and telephone support recorded by member of central study team. |
1. Change in the number of words (personally relevant to the participant) named correctly at 6 months from baseline will be measured by a naming task of 100 pictures presented on the computer.
2. Change in functional communication will be measured by blinded ratings of video-recorded conversations between unfamiliar speech and language therapists blinded to treatment allocation and participants at six months. Conversations will be structured around topics of personal relevance to the participants by the speech and language therapist performing an assessment to ensure the sensitivity of the measure. The same topic guide will be followed by blinded speech and language therapists performing outcome measures. Independent speech and language therapists blinded to treatment allocation and measurement time point will rate the videoed conversations at the project coordinating centre using the activity scale of the Therapy Outcome Measures (TOMS) 26 .
Improvement in patient perception of communication will be measured using the Communication Outcomes After Stroke (COAST) questionnaire at six months - a patient-centred, patient-reported measure of communication related activity, participation and quality of life 27 .
Evidence of treatment effect will be measured by repeating all outcome measures at nine and 12 months from baseline, in addition to the primary end point of 6 months. The nine-month time point is included as an interim measure as drop out from the study was found to increase over time in the pilot study 13 .
Generalisation of treatment to retrieval of untreated words will be measured using the Naming Objects subtest from the Comprehensive Aphasia Test. Carer perception of communication effectiveness will be measured using the Carer COAST questionnaire 28 . Carer quality of life will be measured using the last five items of the Carer COAST questionnaire 28 and the CarerQol questionnaire 29 . Negative effects of treatment will be reported through diaries. Table 1 summarises the main measures and methods of data collection. Follow-up assessments will be conducted within one month of the target time point.
Following baseline assessment, the participant will be randomised to one of the three trial intervention arms. Randomisation will be performed by an online randomisation system developed and maintained through the Sheffield Clinical Trials Research Unit (CTRU). The randomisation sequence will be generated in advance by the trial statistician. Randomisation will be stratified by centre (as heterogeneity between centres is expected), and according to severity of word retrieval at baseline, based on percentage scores on the Naming Objects subtest of the Comprehensive Aphasia Test (severe = 10 to 34%, moderate = 35 to 64%, and mild = 65 to 90%). The research speech and language therapist will then inform the participant which group they have been allocated to and draw their attention to the description of this group in the information sheet.
This is a single blind study. The patient participants are not blind to their treatment allocation. The speech and language therapists performing baseline assessments will do this prior to randomisation. A second speech and language therapist at each site, blinded to group allocation, will perform follow-up assessments. The speech and language therapist setting up the treatment will ask participants not to discuss treatment with the person coming to carry out the follow-up measures. It is possible that unblinding will happen during conversation and the speech and language therapists will be asked to record instances of this. A primary outcome is functional communication in conversation. Video recordings of conversations will be presented in random order to speech and language therapists in the project coordinating centre to rate, blind to treatment allocation and follow-up time. The chief investigator, study manager, statisticians and health economist will all be blind to group allocation.
Usual care for this pragmatic study may consist of participation in a range of activities to a greater or lesser extent. Usual care varies across the country in terms of type, frequency and length of provision, and is dependent upon available resources in each locality. Findings from the pilot study confirmed that usual care for four months or more following a stroke may include: face-to-face speech and language therapy targeting language impairment (reading, writing, speaking or understanding); therapy focussing on compensatory communication strategies, provision of communication aids or psychological support; attendance at voluntary support groups or informal communication support from family and friends. Usual care will be recorded retrospectively for three months prior to the study and throughout the study on the case report forms for all groups. Those who are randomised to the usual care group will not receive any project specific intervention.
A structured intervention is proposed in addition to usual care as tested in the pilot study. The intervention targets word retrieval as it is one of the challenges most frequently experienced by people with aphasia, restricting their communication. The three components of the intervention are as follows:
Qualified speech and language therapist assessment, tailoring of exercises and monitoring
The speech and language therapist at each site will tailor computer exercises to the individual using 100 words of personal relevance chosen by the participant. Photographs imaging the 100 words will be selected from those existing in the software, or can be added from a digital camera or from image stores on a computer. The computer software (StepbyStep© by Steps Consulting Ltd, Gloucester, UK) 30 enables the speech and language therapist to select exercises using these words that follow steps in the therapy process that the therapist would take if delivering it face to face. The speech and language therapist bases the selection of exercises on language skills demonstrated in the initial language assessments. The speech and language therapist will provide initial demonstration of the software exercises, check that the individual is able to use the software and monitor the appropriateness of the tailored exercises. This is expected to take only three to four hours, based on the pilot study 13 , as the computer intervention is predominantly self-managed by the patient.
Regular self-managed practice
The participant will then be asked to work through the exercises on the computer and be encouraged to practise each day for 20 to 30 minutes. Participants will be given a six-month period to work though the therapy material on the computer and practise using the new vocabulary in their daily lives. As this is a pragmatic trial, those participants who have the software installed on their own computers will not be prevented from continuing to practise if they wish, following the six-month supported intervention time. Any continued use of software beyond the six months will be recorded.
Volunteer support to assist with treatment adherence and carry over into daily activity
To enhance treatment adherence, the speech and language therapist will provide training to local volunteers who already have a working relationship with the SLT department or SLT assistants based in the department. They will use the three-hour training programme and instruction book (University of Sheffield, Sheffield, UK) developed and evaluated during the pilot study. The volunteer will be asked to visit the participant once a month for an hour, or every two weeks for half an hour (to suit the patient), carrying out the following tasks: provide technical assistance; observe and encourage use of computer exercises; check results and discuss difficulties; assist the participant to move on to harder tasks in the therapy process pre-programmed by the speech and language therapist; encourage the use of new words in everyday situations, conversation and discussions with family about how to encourage use and encourage re-use of completed exercises over time.
The participants will be able to contact the volunteer or SLTA by telephone for technical advice on computer use between planned visits if necessary. Volunteers and SLTAs will be asked to complete a feedback form on each face-to-face session with a participant and send it to the therapist to enable them to provide tailored advice and support. They therapists are also encouraged to meet with all the volunteers/SLTAs together every two months for support and discussion of issues arising.
The majority of the practice time involved in the intervention is self-managed by the participant through regular use of the aphasia computer software. The therapists, SLTAs and volunteers will be asked to keep diaries of resource use showing direct and indirect (telephone and computer set up) time spent and therapist grade (see Table 1).
The third group in this study intends to control for the potential impact of elements of the intervention which of themselves do not provide or require specific speech and language intervention.
Participants randomised to this arm will be provided with generalised activities to carry out and general attention in addition to usual care. On allocation to this group, the speech and language therapists conducting baseline assessments will provide books of standard puzzles that can be purchased from most supermarkets or high street shops. Each book will contain enough activities for one to be carried out each day for at least a month. Examples of puzzles include getting through a maze, spotting the difference between pictures, matching objects that are the same, word searches, Sudoku and so forth. The SLT will provide age appropriate puzzle books that match the participant’s linguistic ability as indicated by the baseline assessments. Puzzle books will be colour coded into levels of easy, medium and hard by the clinicians on the research team centrally and a leaflet will be provided to give speech and language therapists guidance on skills required for each level.
A member of the research team will contact the participants or their carer by telephone or email (whichever is preferred by the participant) once a month to provide the attention similar to that given by volunteers in the intervention arm. They will ask if they are enjoying the activities, how many they have managed to do, whether they would like a new puzzle book sent to them for the coming month and whether they would like the same level of difficulty or an easier or harder one. The participants will also have access to these contact details to enable them to ask for easier or harder books at any time if necessary, again, mimicking the access to the volunteers and SLTAs and type of attention available in the intervention arm.
The speech and language therapists delivering this intervention will receive training on how to set up appropriate exercise steps. To enable monitoring of the treatment fidelity, they will be asked to complete a checklist which guides their selection of exercises based on the participant language profile identified during assessment. These will be reviewed centrally by the study quality monitor. Encrypted and anonymised key files from the participants’ software will be returned to the study team to enable comparison of a random selection of exercises provided with the corresponding checklist completed.
As this is a self-managed intervention, adherence of the participants in using the intervention as intended will be monitored. This will be achieved through volunteer or assistant visits with reminders to practise daily and assistance with using the full range of exercises set. The speech and language therapist will also monitor practice through feedback forms provided by the volunteer or assistant. In addition, the software key files returned to the study coordinating team centrally will be reviewed for total practice time and patterns of practice over the six-month treatment period. Practice with the computer for a minimum of 20 minutes three times a week at home on average will be considered per protocol to account for periods of illness and holiday. Volunteer and assistant adherence will be monitored through their feedback forms to the speech and language therapists who will record amounts of support provided. A minimum of four hours in total per patient will be considered per protocol. Adherence to the attention control group will be monitored by recording information regarding the number of puzzles completed and the frequency and duration of telephone support calls received. Usual care will be recorded across the study period for all groups.
The study aims to recruit 285 participants across 20 speech and language therapy departments (study sites and centres). The sample size of 285 patients in total (95 per arm) is the maximum sample size estimate across the two primary endpoints (word finding ability and functional conversation ability) and key secondary endpoint (patient perception of communication ability) for 90% power and a two-sided significance level of 5%.
For improvement in word retrieval the estimated effect size is 10%, with a standard deviation (SD) of 17.38%, from an analysis of covariance (based on results of the pilot study 13 ). For assessment of conversation the estimated effect size is 0.45 of a SD (with a correlation between baseline and outcome of 0.5 previously observed in the ACT NoW study). For patient-rated improvement using the COAST questionnaire the estimated effect size is 7.2, with a standard deviation (SD) of 13.5 (with an assumed correlation between baseline and outcome of 0.5). The observed dropout rate was 5 out of 33 (15%; 95% CI: 5 to 32%) in the pilot study, which translated to a completion rate of 28/33 (85%; 95% CI: 68 to 95%) 31 .
The initial phase of the study will be conducted as an internal pilot trial and will include clear criteria to inform decisions about progression. Data from the internal pilot will be included in the final analysis. The internal pilot trial will be limited to six sites (over 25% of the total), representative of the sites which will be in the substantive study. However, during this phase we will recruit and commence set-up processes for all the intended sites. The progression criteria will be reviewed eight months from site set-up of the sixth site in the internal pilot trial. We are estimating that this will be approximately halfway through the recruitment phase, at 22 months from contract start.
The progression will be based on achieving the following criteria: recruitment of no fewer than 30 participants (10% of the target for the full trial), a minimum participant retention rate of 65%, 80% of participants having been offered a volunteer and 70% of participants continuing to be supported by the same volunteer for their six-month treatment period.
Patients with at least one post-randomisation observation will be included in the analysis. Missing data will be described using summary statistics. Data will be checked and cleaned blind to the actual treatment allocation. Data checking will be conducted throughout the study and prior to any analysis of the data.
Primary and key secondary endpoints for the comparisons of control to intervention and active control to intervention will be analysed using a Hochberg testing procedure, which allows for an investigation of all three endpoints whilst maintaining the overall type I error at 5% 32 . This approach has the advantage of not inflating the sample size while maintaining the type I error rate at 5%.
Significance will be declared for the comparison of usual care to intervention if and only if both primary outcomes, word retrieval and conversation, are significant at the 5% level, or if either comparison is significant at 2.5%. If and only if significance is declared for both primary outcomes, a similar comparison of attention control to intervention will be made. Significance will be declared for the comparison of attention control to intervention if and only if both word retrieval and conversation are significant at the 5% level, or if either comparison is significant at 2.5%.
If and only if significance is declared for the comparison of attention control to intervention for both comparisons will the key secondary outcome measure (patient perception of communication and related quality of life, measured using the COAST rating scale) be used in a further comparison of usual care to intervention. If and only if this comparison is significant at the 5% level will the intervention be compared to attention control based on the COAST questionnaire (see Figure
Figure 2
Statistical testing procedure.
Statistical testing procedure. COAST = Communication Outcomes After Stroke questionnaire.
Primary analysis will take an intention-to-treat approach (ITT) for all key measures, and further exploratory analysis of participants who complied with the intervention will be undertaken using the same statistical tests, according to the per protocol principle (PP). Only patients with post-randomisation observations will be included in the primary analysis at six months. A sensitivity analysis responses will be imputed as appropriate with details provided in the statistical analysis plan.
The mean difference in percentage improvement of words named correctly between the treatment and control groups, adjusted for baseline naming ability, will be analysed using an analysis of covariance (ANCOVA). Terms for treatment and baseline will be fitted into the model. Assumptions underlying the analyses will be assessed by inspection of residual plots. Homogeneity of variance will be assessed by plotting the studentised residuals against the predicted values from the model, whilst Normality will be assessed by use of Normal probability plots. If the assumptions for the analysis of variance are violated then appropriate transformations may be applied or alternative analyses may be performed. Similar analyses will be undertaken for the endpoints of functional conversation ability (measured by the activity scale of the Therapy Outcome Measures and patient-reported communication outcomes (the COAST questionnaire). The endpoints at nine and 12 months will be similarly analysed for exploratory purposes. Likewise an investigation of trends over time will be made.
A cost utility analysis will be undertaken from the NHS and personal social service (PSS) perspective. Due to the use of volunteers to help participants with their use of the computer program we will undertake a supplementary analysis taking a societal perspective. Costs will be estimated for individual patients, including intervention costs and SLT support and coordination time (collected through diaries as shown in Table 1), combined with standard costing sources 33 . In the pilot study we collected other resource use data (on, for example, GP and hospital visits and prescribed medications) via patient and carer diaries, but these did not show important differences between treatment groups and we will not collect such data in the full trial. The EQ-5D questionnaire will be administered at every data collection time point (see Table 1) and will be combined with standard valuation sources to measure the QALYs gained in each treatment arm 34 . An accessible version of the EQ-5D designed for people with aphasia was trialled in the pilot study. This has not been validated but represents a way in which EQ-5D scores can be elicited directly from patients. We will administer this version of the EQ-5D alongside the standard version which will be completed by carers (where the participant has a carer) by proxy. EQ-5D and CarerQoL scores will also be elicited from carers (Table 1).
We developed a Markov model to estimate the cost effectiveness of the computer intervention alongside our previous pilot study. Model parameters were informed by clinical data from the trial. We estimated that the intervention was likely to be cost effective, with an incremental cost effectiveness ratio (ICER) of £3,058 per QALY gained, however results were uncertain and the value of obtaining further (perfect) information was very high (expected value of perfect information (EVPI) was approximately £37 million). This model will be updated with data from the full trial. The third attention control group will be added to the model. Differences between costs and QALYs in the three groups will be described and an incremental analysis will be performed with ICERs calculated. Probabilistic sensitivity analysis will be undertaken to allow the production of cost effectiveness acceptability curves 33 and value of information analyses 35 .
The speech and language therapists carrying out outcome measures will receive training on how to deliver the assessments reliably, including scoring criteria and benchmarking of scoring video-recorded assessments with other assessors. Site monitoring visits will also be carried out within the first six months of recruitment (and more frequently if required) to check accurate completion of case report forms, adherence to the protocol for taking consent and discussion of any issues arising.
Chronic aphasia has a considerable impact on a person’s ability to participate in many personal, social and work activities. Despite evidence of the potential for continued language improvement over time with intensive practice of targeted, salient language therapy exercises, opportunities to participate in such ongoing therapy are limited due to resource pressures. There is preliminary evidence of the potential for computer software developed for aphasia therapy to provide new opportunities for ongoing aphasia therapy for patients to participate in for as long as they wish and/or benefit. Indeed, there is an increase in the software options being developed for independent language practice. In order for health services or private practitioners and the public to invest in this option it is crucial to know whether such interventions are clinically and cost effective. This protocol describes the first fully powered RCT of long term aphasia therapy delivered through self-managed computerised language exercises, with the support of volunteers or assistants. The protocol also describes the process for the first full economic analysis of a computerised aphasia intervention.
The therapy under investigation is a complex intervention of word finding therapy for aphasia. Previous studies, including the pilot study informing this protocol, have shown that people with aphasia learn the words that are meaningful to them more successfully than those they have little functional need for. As in many rehabilitation interventions, this therapy is driven by the patient’s own goals. Communication needs to achieve different goals are discussed with the therapist and a range of words key to achieving those goals are identified. The personalisation of the therapy goals requires some personalisation in the measurement of whether they have been achieved. The design of outcome measures which can be used to make group comparisons whilst maintaining accurate measurement of individual goals was a challenge. Discussions resulted in two primary outcome measures. The first measures word finding ability whereby all participants have comparable word finding scores from naming 100 pictures. Measurement of word finding of personally meaningful and useful words is achieved by allowing the 100 words to be different for each individual according to their goals. Similarly, the second measures ability to communicate in conversation. All conversations are rated using the activity scale of the TOMS so group comparisons can be made. Measurement of individual goals is maintained by structuring the conversations around the communication areas identified as personally relevant by each individual.
Other key issues in designing the protocol arose from the pragmatic nature of the study. First of all, in order to recruit sufficient numbers of participants, at least 20 speech and language departments are required across the United Kingdom. This will allow generalisation of the results to the population of the United Kingdom. However, we expect considerable variation in the usual care provided to people with aphasia in the long term post stroke, with some sites providing impairment based interventions face to face for several months, and others limiting their service provision to hospital care or for a few weeks post-hospital discharge only. The intervention being tested could be implemented in addition to any existing services in practice. The study therefore uses an adjunct design whereby patients continue to receive any ongoing care. This may have the added benefit of recruiting those patients who would not wish to be randomised away from usual care. To account for the heterogeneity expected, the randomisation is to be stratified by site, ensuring representation of different models of usual care in each study group.
There are challenges in involving people with aphasia in research, as they often have difficulty reading or understanding spoken language. The protocol for obtaining informed consent therefore needed careful consideration. In order to adhere to the Mental Capacity Act (2005) in England and the Adults with Incapacity Act (2000) in Scotland, a consent support tool has been included to identify reading and spoken comprehension ability of individuals and recommend the style of information that is likely to best inform each individual. The tool also identifies those participants whose aphasia severity is such that they are unlikely to understand the information sufficiently to provide informed consent and therefore need the involvement of a carer, relative or legal representative. In addition, the reading deficits make completion of standard questionnaire tools such as the EQ-5D difficult and unreliable. We therefore developed and tested an accessible EQ-5D which uses illustrations and visually represented extent of difficulty.
There are three groups in the study. Introducing a three-way comparison increases the required sample size and therefore poses a potential threat to the power of the study if recruitment is insufficient. However, a three-way comparison is not required here as the first question to answer is whether the computerised intervention is more effective than usual care alone. Only if the answer to the first question is positive is there a need to ask whether it is the speech and language therapy components that cause the effectiveness shown. In this case a second comparison of computer intervention to activity and/or attention control needs to be carried out. The Hochberg analysis was chosen to allow for these consecutive comparisons, thus also maintaining a more achievable sample size.
Finally, the set-up of 20 individual speech and language therapy departments to participate in the study is a considerable challenge, in which service support and excess treatment costs must be negotiated at each site independently, with a large range of local policies and financial restrictions across the United Kingdom.
The study has received ethical approval and fifteen participants have been recruited from the first five sites set up.
ANCOVA: Analysis of covariance
CAT: CIAT, Constraint induced aphasia therapy
COAST: Communication Outcomes After Stroke
CST: Consent support tool
CTRU: Clinical Trials Research Unit
EVPI: Estimated value of perfect information
ICER: Incremental cost effectiveness ratio
ISRCTN: International standard randomised controlled trial number
MOAT: Model oriented aphasia therapy
NHS: National Health Service
NIHR: National Institute of Health Research
PSS: Personal social service
QALYs: Quality-adjusted life years
RCT: Randomised control trial
SLT: speech and language therapy
SLTA: Speech and language therapy assistant
TOM: Therapy Outcome Measures
The authors declare they have no competing interests.
RP is the chief investigator of the study and led the protocol design and the writing of this manuscript. CC, PE, MB and AB contributed to the design of the protocol and helped to draft the manuscript. SJ carried out the power calculation and designed the analysis plan. NL designed and wrote the health economic sections of the protocol. All co-authors read and approved the manuscript.
This report is independent research funded by the National Institute for Health Research (Health Technology Assessment number: 12/21/01AB; Clinical and cost effectiveness of aphasia computer therapy compared with usual stimulation or attention control long term post stroke (CACTUS)). RP is partially funded by an NIHR/HEFCE (Higher Education Council for England) senior academic clinical lectureship. AB is partially funded by the National Institute for Health Research Collaboration for Leadership in Applied Health Research and Care (NIHR CLAHRC), Greater Manchester. MB is partially funded by the Chief Scientist Office (CSO), Scottish Government Health and Social Care Directorates. The views expressed in this article are those of the authors and not necessarily those of the NHS, CSO, NIHR or the Department of Health.
On behalf of the Big CACTUS project we would like to thank Liz Cross, Madeleine Harrison, Helen Hughes, Tim Chater, Ellen Bradley and Annabelle Allison.
Department of Health
Speech and language therapy for aphasia following stroke
Randomized controlled trial on very early speech and language therapy in acute stroke patients with aphasia
Clinical effectiveness, cost effectiveness and service users’ perceptions of early, well-resourced communication therapy following a stroke, a randomised controlled trial (The ACT NoW Study)
Long term stability of improved language functions in chronic aphasia after constraint-induced aphasia therapy
Translational research in aphasia: from neuroscience to neurorehabilitation
Treatment-induced neuroplasticity following intensive naming therapy in a case of chronic Wernicke’s aphasia
Aphasia therapy on a neuroscience basis
Constraint induced therapy of chronic aphasia after stroke
Evidence-based systematic review: effects of intensity of treatment and constraint-induced language therapy for individuals with stroke-induced aphasia
Intensive language therapy in chronic aphasia: which aspects contribute most?
Treatment of acquired aphasia: speech therapists and volunteers compared
Computer therapy compared with usual care for people with long standing aphasia post stroke: a pilot randomized controlled trial
Oral Reading for Language in Aphasia (ORLA): evaluating the efficacy of computer-delivered therapy in chronic nonfluent aphasia
Aphasia rehabilitation and the role of computer technology: can we keep up with modern times?
A computer-implemented protocol for treatment of naming disorders: evaluation of clinician-guided and partially self-guided instruction
Superhighway to promoting a client-therapist partnership: using the internet to deliver word-retrieval computer therapy monitored remotely with minimal speech and language therapy input
Department of Health
The efficacy of computer-provided reading treatment for chronic aphasic adults
Using computers to enable self-management of aphasia therapy exercises for word finding: the patient and carer perspective
Cost-utility of self-managed computer therapy for people with aphasia
Extending the CONSORT statement to randomized trials of nonpharmacologic treatment: explanation and elaboration
for the Consort group
Initial evaluation of the consent support tool: a structured procedure to facilitate the inclusion and engagement of people with aphasia in the informed consent process
Development of a reliable self-report outcome measure for pragmatic trials of communication therapy following stroke: the Communication Outcome after Stroke (COAST) scale
Communication outcome after stroke: a new measure of the carer's perspective
on behalf of the ACT NoW Study
The CarerQol instrument: a new instrument to measure care-related quality of life of informal caregivers for use in economic evaluations
Modeling valuations for EuroQol health states
Exploring the research decision space: the expected value of information for sequential research designs


Demonstrate how to:
<svg>
,
This example is based on Mike Bostock's Drag & Zoom II Block. The original source with its supporting explanation can be found by following the link below.
Source:
The implementation is a straightforward Angular component without any inputs. Its template is an
<svg>
element with fixed dimensions. The component renders the visualization using the
d3
instance provided by the injected
D3Service
.
The D3 component can be embedded into a parent component using the following tag:
<app-brush-zoom-2 [width]="width" [height]="height" [phylloRadius]="phylloRadius" [pointRadius]="pointRadius"></app-brush-zoom-2>
.
|
|
|||
|---|---|---|---|
| Width | {{selectedLayout.width}} | Height | {{selectedLayout.height}} |
| Radius (Phyllotaxis) | {{selectedLayout.phylloRadius}} | Radius (Point) | {{selectedLayout.pointRadius}} |


Module 01: Introduction to HTML
Created by: Ed Abshire
Easy Breakfast Biscuits and Gravy
This recipe for biscuits and gravy is amazing and easy!
More Recipes:


// Tell your computer how to do something
function helloWorld(){
var name = "GDI";
alert("Hello world, it's " + name + "!");
}
// Then make it do that thing!
helloWorld();
Girl Develop It is here to provide affordable and judgment-free opportunities for women interested in learning web and software development.
Some "rules":
Introduction and Fundamentals
Getting set up Data types, operators, comparators, and variablesWhat is JavaScript?
Let's write your first JavaScript program!
alert('Hello World!');
What action resulted?
---
Ask questions!
Variables represent information
var x;
x = 1;
x + 2; // = 3
var
var lsp; // declared but undefined
lsp = "Lumpy Space Princess"; // initialized
var lsp = "Lumpy Space Princess"; // declared and initialized
$
, or _
$
is used by the jQuery library_
is used by the underscore.js libraryvar thisIsMyVariable;
Once you have declared a variable, you can use it in your code. Just type the name of the variable.
var numberOfKittens = 5;
console.log(numberOfKittens);
The value of a variable can change (be updated) later. (You don't need to re-use var
).
numberOfKittens = 13;
console.log(numberOfKittens);
In your console, create a variable and set it equal to a value. Then, display the value.
Next, try this one:
var kittenTitle = 'Admiral';
var kittenName = kittenTitle + ' Snuggles';
console.log(kittenName);
What did you get?
You're so fancy
| Number | |
|---|---|
| Integers | 0, 1, 2 ... 9 |
| Floats (decimals) | 0.5, 1.618, 3.14 |
| String | "GDI", 'rock on', "three" |
| Boolean | true or false |
| Null | null |
| Undefined | undefined |
| Object | Stay tuned... |
| + | Addition |
|---|---|
| - | Subtraction |
| ++ | Increment (+1) |
| -- | Decrement (-1) |
| * | Multiplication |
| / | Division |
| % | Modulus (remainder) |
| ! | Is Not |
|---|---|
| == | Equality |
| != | Inequality |
| === | Identity/strictly equal |
| !== | Non-identity |
| > | Greater than |
| >= | Greater or equal |
| < | Less than |
| <= | Less or equal |
Experiment with Data Types,
Operators and Comparators
3.2 - 4
"GDI" + "Cbus"
6 * "six";
( 2 + 3 ) - ( 4 * 12 )
9 / 2
9 % 2
"GDI" == "gdi"
14 >= 14
Try your own! Find any interesting results?
Each instruction in JS is a statement, like:
console.log('Hello Class!');
After each individual statement, you must add a semicolon to end the command.
console.log('I am glad to meet you.');
console.log('Fuzzy Wuzzy Was A Bear');
If it's left off, it's up to the browser to decide what you meant.
// Open a popup box:
alert('Hello World!');
alert(2015 / 746);
// Display a message in your console:
console.log('Hello World!');
console.log(14++);
// Add something to the page:
document.write('Hello World!');
document.write('kittens' === 'kittens');
You can leave comments in your code that won't be processed in the script.
/*
A comment block
For a longer comment that spans multiple lines
*/
console.log('Hello World!'); // A shorter (single-line) comment
Comments act as notes that people can read and computers will ignore.
// This code multiplies puppies by kitties
var puppies = 10;
var kitties = 11;
document.write(puppies * kitties);
Working with JavaScript
Functions, arrays, and loops==
vs ===
)
var students = "Javascript stars!";
Writing multiple lines in your console gets tough, so let's switch to Codepen.io.
function add(value1, value2){
console.log(value1 + value2);
} // Declared, now it exists!
// Another way of writing it
var add = function(value1, value2) {
console.log(value1 + value2);
}; // Stored as a variable
function
name
()
{}
function name(argument1, argument2){
statement;
statement;
statement;
} // No ending semi-colon!
functionName();
function helloWorld(){ // Declared function named helloWorld
document.write("Hello world!"); // What you want it to do
}
helloWorld(); // Call the function
Once defined, you can call the function as many times as you want!
Reusable code!
function callKitten(kittenName){
console.log('Come here, ' + kittenName + '!');
}
callKitten('Fluffy'); // Outputs 'Come here, Fluffy!'
callKitten('Admiral Snuggles'); // Outputs 'Come here, Admiral Snuggles!'
callKitten('Fizgig'); // Outputs 'Come here, Fizgig!'
You can re-use the same function for many different arguments!
Reusable code!
function calculateTip(totalBill, percentage) {
document.write(totalBill * percentage/100);
}
calculateTip(12, 20); // outputs 2.4
calculateTip(18, 20); // outputs 3.6
var defaultPercentage = 20;
function calculateTip(totalBill, percentage) {
document.write(totalBill * percentage/100);
}
calculateTip(12, defaultPercentage); // outputs 2.4
calculateTip(18, defaultPercentage); // outputs 3.6
Use Codepen.io to try the following:
subtract
value1
and value2
alert
or document.write
)Use Codepen.io to try the following:
sayMyName
firstName
and lastName
alert
or document.write
) a string that joins firstName
and lastName
sayMyName
called greet
firstName
and lastName
alert
or document.write
) a greeting with your name (e.g. "Hello, Kim Hamper!")strings
The keyword return
produces a value at the end of the function
var numberOfKittens = 5;
var numberOfPuppies = 4;
function addAnimals(puppies, kittens){
return puppies + kittens;
}
// Save the returned value as a variable
// then output the variable
var totalAnimals = addAnimals(numberOfPuppies, numberOfKittens);
document.write(totalAnimals);
// Output the returned value directly
document.write(addAnimals(numberOfPuppies, numberOfKittens));
Immediately exits the function
var numberOfKittens = 5;
var numberOfPuppies = 4;
function addAnimals(puppies, kittens){
return puppies + kittens;
console.log(puppies > kittens); // Will never get to this line
}
addAnimals(numberOfPuppies, numberOfKittens); // Has returned 9
var arrayName = [thing0, thing1, thing2, thing3];
[]
value
of arrayName
at index 0
is thing0
var colors = ['Red','Orange','Yellow','Green','Blue','Indigo','Violet'];
var lotteryNumbers = [33, 72, 64, 18, 17, 85];
var mixOfThings = ['Cheese', 100, 'Sherlock', ["array","in","array"]];
Access items in an array using bracket notation:
var catNames = ['Fluffy','Admiral Snuggles','Fizgig'];
var firstCat = catNames[0]; // Zero-based! Sets firstCat to 'Fluffy'
var lastCat = catNames[2]; // Sets lastCat to 'Fizgig'
Change a particular value by accessing its index
using bracket notation
catNames[2] = 'Fizzgig'; // Fix that spelling!
console.log(catNames);
Get the length of an array with .length
var numberOfCats = catNames.length; // sets numberOfCats to 3
Add something to the end of an array with .push()
var catNames = ['Fluffy','Admiral Snuggles','Fizgig'];
catNames.push('Miss Havisham');
console.log(catNames);
What if we wanted to simplify this?
Could we write a function?
var catNames = ['Fluffy','Admiral Snuggles','Fizzgig','Miss Havisham'];
function printNames(arrayOfNames) {
// Print out each cat name
// What goes here?
}
printNames(catNames);
Process a set of data by iterating through the set
and performing an action to each item
while
loopsfor
loopsRepeats the same code over and over until some condition is met
Let's try an example:
var numberOfTacos = 10;
while (numberOfTacos > 0) {
console.log('OM NOM NOM'); // Eat a taco
numberOfTacos--; // What does this do?
}
while (numberOfTacos > 0)
is the ending condition
while (numberOfTacos)
= sadface!while (numberOfTacos < 100)
= sadface!Make sure something changes in the loop, or your loop will go on forever...
For loops are very similar, but you declare a counter in the statement.
Let's try an example:
// will count 1 to 10
for (var i = 1; i <= 10; i++) {
console.log(i);
}
To exit a loop, use the break statement.
//Count from 100 to 200
for (var i = 100; i <= 200; i++) {
console.log('Testing ' + i);
//Stop at the first multiple of 7
if (i % 7 == 0) {
console.log('Found it! ' + i);
break;
}
}
Use a for loop to easily process each item in an array.
var rainbowColors = ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet'];
for (var i = 0; i < rainbowColors.length; i++) {
console.log(rainbowColors[i]);
}
Go back to our array of catNames and implement the printNames function, using a for
loop:
var catNames = ['Fluffy','Admiral Snuggles','Fizzgig','Miss Havisham'];
function printNames(arrayOfNames) {
// Print out each cat name
// What goes here?
}
printNames(catNames);
Use a for
loop to display a list of all your favorite foods. Use the previous lab as a guide.
Display a list of your favorite foods again, but this time use a while
loop.
run
to process your codeRemember:
Every question is important!


One of the best Dairy Farming Solutions in Bengaluru
Dairy Cattle Trading
Description
LN2 Containers
Description
Silage
Description
CAPTION
CAPTION
CAPTION
CAPTION
CAPTION
CAPTION
About Us
Our Mission
A To Z Dairy Farming Solutions have been motivated by a clear mission with highest integrity our firm provides dairy industry leading services and genetics to ensure continued success of our customers


Export: executes the export and generates the export.json file.
Refresh: updates the export data to include any changes since the previous update.
The text below each group name indicates the current export settings.
Note: The checkbox selection changes will only be taken into account after the "Refresh" button has been hit and not when the "Export" button has been hit.


Operator: Grupo Aeroportuario del Pacífico
Type: Public
Headquarters Address
Carretera Transpenínsular, s/n km 43.5
Zip. 23420, Municipio de Los Cabos, B.C.S. México.
Phones From USA & Canada
*Country Code: 52 - Mexico
*Area Code: 624 - Los Cabos
011 52<PHONE_NUMBER> /12 / 13
011 52<PHONE_NUMBER> /06 / 07 / 08
From Mexico (Dial 01 instead of 011 52)
LONG DISTANCE TO MEXICO APPLIES WHEN CALLING THESE NUMBERS.
Website: http://www.aeropuertosgap.com.mxAirport Codes:
IATA Code: SJD
ICAO Code:MMSD
Current Date / Time (xxxxxx)
Time Zone: -7:00 from GMT (UTC)
Airport Localization:
*Latitude = 23.166668; 23.166668 ( North 23° 10' 0" ).
* Longitude = -109.7; -109.7 ( West 109° 41' 59" )SJD the fifth most important airport in Mexico located at San José del Cabo, Baja California Sur, Mexico serviced 1,902,303 passengers for 2004.
The airport serves Los Cabos area: San José del Cabo and Cabo San Lucas. This airport has three terminal with 4 concourses.
Related terms with SJD Airport:Airport cabo - airport code sjd - airport code for cabo san lucas - airports in baja -airport in cabo san lucas - airports near cabo san lucas - baja airport, cabo airport - cabo san lucas airport code -cabo san lucas international airport -los cabos international airport - los cabos mexico airport -los cabos airport code - san jose cabo airport -
san jose del cabo airport - san jose del cabo international airport - san lucas mexico airport -sjd airport


Chapter 5 Panel data structures
5.1 Reviewing the basics
5.1.1 Within, between and variance components
Hausman and Taylor (1981)
###############################################################################
# Illustration of bias and RMSE with pooling, within and variance components
###############################################################################
# Follows notation of the type used in: Hausman and Taylor (1981): "Panel Data
# and Unobservable Individual Effects," Econometrica 49(6):1377-1398.
###############################################################################
MC.panel.loop <- function(r=100,N=100,T=5,pi_alpha=0.0,pi_eta=0.0){
RNGkind(kind="Super-Duper")
beta <- 0 ; sigma_alpha <- 2 ; sigma_eta <- 1 ; sigma_X_tilde <- 1
a <- rep(rnorm(N*r,mean=0,sd=sigma_alpha),each=T)
ALPHA <- matrix(a,N*T,r)
e <- rnorm(N*T*r,mean=0,sd=sigma_eta)
ETA <- matrix(e,N*T,r)
x_tilde <- rnorm(N*T*r, mean=0, sd=sigma_X_tilde)
X_tilde <- matrix(x_tilde,N*T,r)
X <- ALPHA*pi_alpha + ETA*pi_eta + X_tilde
Y <- X*beta + ALPHA + ETA
# Definition of "annihilator" matrices as on top of p. 1380
I_N <- diag(x=1,nrow=N)
I_TN <- diag(x=1,nrow=N*T)
J <- matrix(1,T,1)
b <- (J%*%(1/T)%*%t(J))
PV <- I_N%x%b
QV <- I_TN - PV
# Within and between transformations
X_W <- QV%*%X
X_B <- PV%*%X
Y_W <- QV%*%Y
Y_B <- PV%*%Y
est.ols <- matrix(0,1,r)
est.within <- matrix(0,1,r)
est.between <- matrix(0,1,r)
est.varETA <- matrix(0,1,r)
est.varTOTAL <- matrix(0,1,r)
est.varALPHA <- matrix(0,1,r)
est.theta <- matrix(0,1,r)
est.varcomp <- matrix(0,1,r)
Y_G <- matrix(0,N*T,r)
X_G <- matrix(0,N*T,r)
for(i in 1:r){
est.ols[,i] <- solve(crossprod(X[,i]))%*%crossprod(X[,i],Y[,i])
# As in equation (2.3) on p. 1380
est.within[,i] <- solve(crossprod(X_W[,i]))%*%crossprod(X_W[,i],Y_W[,i])
# As in equation (2.4) on p. 1380
est.between[,i] <- solve(crossprod(X_B[,i]))%*%crossprod(X_B[,i],Y_B[,i])
est.varETA[,i] <- crossprod(Y_W[,i] - X_W[,i]*est.within[,i])/(N*(T-1))
est.varTOTAL[,i] <- crossprod(Y_B[,i] - X_B[,i]*est.within[,i])/(N*T)
est.varALPHA[,i] <- est.varTOTAL[,i] - (est.varETA[,i])/T
# Calculate variance components as in Proposition 2.1 on p. 1381
est.theta[,i] <- (est.varETA[,i]/(est.varETA[,i]+T*est.varALPHA[,i]))^0.5
Y_G[,i] <- Y[,i] - (1 - est.theta[,i])*Y_B[,i]
X_G[,i] <- Y[,i] - (1 - est.theta[,i])*X_B[,i]
# As in equation (2.5) on p. 1381
est.varcomp[,i] <- solve(crossprod(X_G[,i]))%*%crossprod(X_G[,i],Y_G[,i])
}
dens.ols <- density(est.ols)
dens.within <- density(est.within)
dens.between <- density(est.between)
dens.varETA <- density(est.varETA)
dens.varALPHA <- density(est.varALPHA)
dens.varcomp <- density(est.varcomp)
plot(dens.between, col="red", xlim=c(-2,1), ylim=c(0,20),
main="Montecarlo simulation results",
ylab="kernel density",xlab="between=RED, pooling=BLUE, within=BLACK, var. comp.=PINK
theta=DOTTED, true value of coefficient=GREEN")
lines(dens.ols, col="blue")
lines(dens.within, col="black")
lines(dens.varcomp, col="pink")
lines(density(est.theta), lty=3)
abline(v=beta,col="green")
stats <- rbind("Estimator =",
"Replications =",
"Individuals =",
"Time periods =",
"pi_alpha =",
"pi_eta =",
"varETA =",
"varALPHA =",
"theta =",
"bias =",
"se =",
"rmse =")
mean.varETA <- mean(est.varETA[1,])
mean.varALPHA <- mean(est.varALPHA[1,])
mean.theta <- mean(est.theta[1,])
bias.ols <- mean(est.ols[1,]) - beta
se.ols <- var(est.ols[1,])^0.5
rmse.ols <- mean(((est.ols[1,] - beta)^2 + var(est.ols[1,]))^0.5)
bias.within <- mean(est.within[1,]) - beta
se.within <- var(est.within[1,])^0.5
rmse.within <- mean(((est.within[1,] - beta)^2 + var(est.within[1,]))^0.5)
bias.varcomp <- mean(est.varcomp[1,]) - beta
se.varcomp <- var(est.varcomp[1,])^0.5
rmse.varcomp <- mean(((est.varcomp[1,] - beta)^2 + var(est.varcomp[1,]))^0.5)
s.ols <- rbind("Pooling",
r,
N,
T,
pi_alpha,
pi_eta,
round(mean.varETA,4),
round(mean.varALPHA,4),
round(mean.theta,4),
round(bias.ols,4),
round(se.ols,4),
round(rmse.ols,4))
s.within <- rbind("within",
r,
N,
T,
pi_alpha,
pi_eta,
round(mean.varETA,4),
round(mean.varALPHA,4),
round(mean.theta,4),
round(bias.within,4),
round(se.within,4),
round(rmse.within,4))
s.varcomp <- rbind("varcomp",
r,
N,
T,
pi_alpha,
pi_eta,
round(mean.varETA,4),
round(mean.varALPHA,4),
round(mean.theta,4),
round(bias.varcomp,4),
round(se.varcomp,4),
round(rmse.varcomp,4))
results <- cbind(stats,s.ols,s.within,s.varcomp)
print(results)
}
system.time(MC.panel.loop(500,400,5,-0.1,0.0))
## [,1] [,2] [,3] [,4]
## "Estimator =" "Pooling" "within" "varcomp"
## r "Replications =" "500" "500" "500"
## N "Individuals =" "400" "400" "400"
## T "Time periods =" "5" "5" "5"
## pi_alpha "pi_alpha =" "-0.1" "-0.1" "-0.1"
## pi_eta "pi_eta =" "0" "0" "0"
## "varETA =" "1.0021" "1.0021" "1.0021"
## "varALPHA =" "3.9665" "3.9665" "3.9665"
## "theta =" "0.2197" "0.2197" "0.2197"
## "bias =" "-0.3838" "-5e-04" "0.3116"
## "se =" "0.0512" "0.0245" "0.0142"
## "rmse =" "0.3872" "0.0331" "0.312"
## user system elapsed
## 9.19 0.18 11.36
Doing the within transformation by hand on real world data
USE EXAMPLE FROM THE PNIR PAPER
# Load the data and attach the variable names.
pnir <- read.table("pnir.txt",header=TRUE)
pnir$count <- ave(pnir$IDENF, pnir[,c("IDENF")], FUN=length)
pnir$t0 <- ifelse(pnir$PERIODE == 0, 1, 0)
pnir$t1 <- ifelse(pnir$PERIODE == 1, 1, 0)
pnir$t2 <- ifelse(pnir$PERIODE == 2, 1, 0)
pnir$t3 <- ifelse(pnir$PERIODE == 3, 1, 0)
pnir$t4 <- ifelse(pnir$PERIODE == 4, 1, 0)
table(pnir$count)
##
## 1 2 3 4 5
## 313 304 363 200 135
hist(pnir$AGENF)
hist(pnir$FEMALE)
pnir1 <- subset(pnir, pnir$count > 1)
pnir2 <- aggregate(pnir1, by = list(pnir1$IDENF), FUN=mean, na.rm = TRUE)
pnir3 <- merge(pnir1, pnir2, by = "IDENF",suffixes = c("", "_B"))
# Do the "within-child" transformation simply by taking the difference of two matrices
mpnir3 <- as.matrix(pnir3)
mpnir3P <- mpnir3[,1:32]
mpnir3B <- mpnir3[,33:64]
mpnir3W <- mpnir3P - mpnir3B
mpnir3W1 <- mpnir3W[,5:32]
# This constructs the within-child dataframe
pnir4 <- data.frame(cbind(pnir1$IDENF, pnir1$IDM, pnir1$CODEVILL, mpnir3W1))
haz.lm <- lm(HAZ ~ -1 + t1 + t2 + t3 + t4 + LPNIR
+ AGENF + LIRECM + LNAGECM
+ PROGALPH + ELECTVI + LOGPOP, data = pnir4)
summary(haz.lm)
##
## Call:
## lm(formula = HAZ ~ -1 + t1 + t2 + t3 + t4 + LPNIR + AGENF + LIRECM +
## LNAGECM + PROGALPH + ELECTVI + LOGPOP, data = pnir4)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.4358 -0.5110 0.0042 0.4744 3.9185
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## t1 -1.189619 0.770065 -1.545 0.12271
## t2 -1.144969 1.207662 -0.948 0.34332
## t3 -1.359885 1.857108 -0.732 0.46418
## t4 -0.978567 2.352187 -0.416 0.67748
## LPNIR 0.545349 0.269926 2.020 0.04361 *
## AGENF 0.008944 0.104053 0.086 0.93152
## LIRECM 0.416358 0.140569 2.962 0.00313 **
## LNAGECM 0.143795 0.668645 0.215 0.82977
## PROGALPH 0.189547 0.085706 2.212 0.02722 *
## ELECTVI 0.331788 0.208340 1.593 0.11158
## LOGPOP -0.214195 0.192483 -1.113 0.26607
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8682 on 991 degrees of freedom
## Multiple R-squared: 0.0879, Adjusted R-squared: 0.07778
## F-statistic: 8.682 on 11 and 991 DF, p-value: 8.14e-15
library(multiwayvcov)
library(lmtest)
haz.vcovCL <- cluster.vcov(haz.lm, pnir1$CODEVILL)
haz.clustered.se <- coeftest(haz.lm, haz.vcovCL, df = 652)
haz.clustered.se
##
## t test of coefficients:
##
## Estimate Std. Error t value Pr(>|t|)
## t1 -1.1896190 0.9209170 -1.2918 0.19689
## t2 -1.1449692 1.5189489 -0.7538 0.45125
## t3 -1.3598851 2.3179838 -0.5867 0.55763
## t4 -0.9785667 2.9878615 -0.3275 0.74338
## LPNIR 0.5453493 0.2625044 2.0775 0.03815 *
## AGENF 0.0089441 0.1357746 0.0659 0.94750
## LIRECM 0.4163577 0.1690447 2.4630 0.01404 *
## LNAGECM 0.1437950 0.4589656 0.3133 0.75415
## PROGALPH 0.1895465 0.1084455 1.7479 0.08096 .
## ELECTVI 0.3317884 0.2493300 1.3307 0.18375
## LOGPOP -0.2141948 0.2582648 -0.8294 0.40720
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
5.1.2 Multidimensional panels
USE EXAMPLE FROM THE BURUNDI PAPER USE EXAMPLE FROM A UNIDO DATA PAPER
USE THE xxxx PACKAGE
5.1.3 Mundlak
Mundlak (1978)
5.1.4 The incidental parameters problem
HAVE CODE ON DISCRETE CHOICE PANEL MODEL
Lancaster (2000)
INCLUDE MULTINOMIAL LOGIT STUFF FROM FIRST CHINA BEAUTY PAPER
5.2 Common situations
5.2.1 Panel data in an RCT
INSERT PROBLEM SET HERE ON LESOTHO DATA
You are going to see whether a $30m Millennium Challenge Corporation (MCC) water program in Lesotho actually did anything for the populations being treated. The impact evaluation was carried out by NORC at the University of Chicago: http://www.norc.org. Go to the project page at:
https://catalog.data.gov/dataset/lesotho-rural-water-supply-and-sanitation
Download all of the materials. In particular, make sure that you have the “Final Evaluation Report Package,” and “Public Use Data Package.” Make sure you can replicate the descriptive statistics of Tables 4, 5 and 6. Replicate, the first two columns in Tables 7, 8 and 9 in the report: i.e. only replicate the columns of results where the heading is “Original Design” or “Observed Design” —ignore the columns where the heading is “Instrumental Variable” or “Matching”. Do this as best as you can: you probably won’t be able to get everything perfect, even in terms of the number of observations or the summary statistics –but you will get close.
Notice that most of the results of Tables 7 and 8 (and one line in Table 9) include household fixed effects. You should carry out the “within” or first-difference transformation (they are identical here because there are 2 observations per household) before running the simple OLS regressions in R. Now carry out randomization inference on the results. Discuss.
Now notice again that most of the results that you just replicated and improved upon using randomization inference are based on regressions that included household fixed effects. But does using fixed effects make sense in the context of an RCT? Why yes or why not?
To guide you in terms of answering, note that last year I gave a problem that asked just this question (which means you already have an informational advantage!). In what follows, I reproduce that question from last year, and then ask you to apply your findings to the Lesotho study.
- Consider an RCT in which we have a baseline and an endline, which is the case here. Denoting the outcome by \(Y_{t}\), in which the baseline corresponds to \(t=1\) and post-intervention (endline) corresponds to \(t=2\), the simple difference between treated and control at \(t=2\) can be written as the OLS regression:% \[ Y_{2}=D_{2}\beta _{D}+U_{2}, \] whereas the DID estimator (which is what the authors of the NORC report did for most outcomes) is given by: \[ Y_{2}-Y_{1}=\left( D_{2}-D_{1}\right) \beta _{DID}+U_{2}-U_{1}, \] where of course \(D_{1}=0\) for everyone. In the absence of serial correlation in the disturbance terms, what should you do, include the fixed effects or not? Assume now that there is first-order serial correlation, that takes the form: \[ U_{2}=\rho U_{1}+e, \] where \(\rho \in \lbrack -1,1]\) and \(e\) is white noise. When should you difference and when should you not? (Hint: you are going to have to look at variances…)
When should you condition on \(Y_{1}\), which would mean running: \[ Y_{2}=Y_{1}\gamma +D_{2}\beta _{COND}+U_{2}? \]
You should answer this part of the question analytically.
Now spend a limited amount of time running a simple Montecarlo experiment. Define potential outcomes as: \[ \begin{eqnarray*} Y_{11} &=&U_{11}, \\ Y_{01} &=&U_{01}, \\ Y_{12} &=&\beta +U_{12}, \\ Y_{02} &=&U_{02}, \end{eqnarray*} \] where: \[ \left( U_{11},U_{01}\right) \sim N\left( \left( 0,0\right) ,\Sigma _{U}\right) =N\left( \left( 0,0\right) ,\left( \begin{array}{cc} \sigma _{U}^{2} & 0 \\ 0 & \sigma _{U}^{2}% \end{array}% \right) \right) , \] and \[ \begin{eqnarray*} U_{12} &=&\rho U_{11}+e_{11}, \\ U_{02} &=&\rho U_{01}+e_{01}, \end{eqnarray*} \] where: \[ \left( e_{11},e_{01}\right) \sim N\left( \left( 0,0\right) ,\Sigma _{e}\right) =N\left( \left( 0,0\right) ,\left( \begin{array}{cc} \sigma _{e}^{2} & 0 \\ 0 & \sigma _{e}^{2}% \end{array}% \right) \right) . \] Generate a random treatment indicator \(D\), and construct observed outcomes as: \[ \begin{eqnarray*} Y_{1} &=&Y_{11}D+Y_{01}(1-D), \\ Y_{2} &=&Y_{12}D+Y_{02}(1-D). \end{eqnarray*} \] Consider the three linear regressions: \[ \begin{eqnarray*} Y_{2} &=&\alpha +D\beta _{D_{2}} \\ Y_{2}-Y_{1} &=&\alpha +D\beta _{DID} \\ Y_{2} &=&\alpha +Y_{1}\gamma +D\beta _{COND}, \end{eqnarray*} \]
and examine the variances of the three estimators as you vary $$.
Now apply the intuition gleaned from both your analytical answer and these Montecarlo results to the Lesotho data, by comparing estimates of program impact based on each of the three estimators, with and without randomization inference. How do things change with respect to the replication exercise you carried out in Problem 1? What estimator do you come down in favor of? Why?
 There are three cross-sectional dimensions to the panel: child (\(i\), IDENF
), household (\(h\), IDM), village (\(v\), CODEVILL
). The time dimension is denoted by \(t\) (PERIODE
).
Covariates in your specifications should include: - period dummies; - the age of the child AGENF
; - whether the household head can read LIRECM
; - the log of the household head’s age LNAGECM
; - whether there is a literacy program in the village PROGALPH; whether the village is hooked up to the national electricity grid ELECTVI
; - the log of the population of the village LOGPOP
.
Suppose that you want to estimate the impact of projects constructed by the PNIR rural infrastructure program (PROJET
) on a child’s weight-for-age z-score (WAZ
). This is a standard anthropometric measures of child health. Treatment by a completed PNIR project obtains at the village level. Your exclusion restrictions for treatment by a PNIR project are given by three measures of village political power (which affect the probability that the village gets a project or not) given by: whether a villager is a member of the majority on the Conseil rural: MBMAJORI
; whether a villager is a member of the biggest party on the Conseil rural: MBMAJOR1
; the number of women from the village on the Conseil rural NBFEMME\_
. Compute the impact of the PNIR using the within-child instrumental variables estimator, and compare this to the corresponding within-household estimator.
BASE THIS ON STUDENT ANSWERS FROM THE 2018 PROBLEM SET 2 (Problem 1, first part)
5.2.3 Selection and endogeneity
Semykina and Wooldridge (2010)
USE MATERIAL FROM SECOND CHINA BEAUTY PAPER
5.3 Time-invariant covariates
Hausman and Taylor (1981)
Suppose, however, that you also want to simultaneously identify (i) the impact on WAZ of whether the child is female (FEMALE) and (ii) whether the impact of treatment by the PNIR differs according to the gender of the child. How would you go about doing this, and what do you find?

People will often tell you that measurement error always results in attenuation bias. Indeed, this sometimes referred to as the “Iron Law of Econometrics.” This problem forces you to think this through more carefully.
Consider the following “true” structural equation: \[ Y_{i}=\widetilde{D}_{i}\beta +U_{i}, \] but where we have “classical” errors in variables (CEV) in the treatment dummy in that observed treatment, \(D_{i}\), is given by: \[ D_{i}=\widetilde{D}_{i}+V_{i}, \] where \(E\left[ V_{i}\right] =0,\) \(cov[ \widetilde{D}_{i},V_{i}]=0,\) \(cov\left[ U_{i},V_{i}\right] =0,\) \(cov[ U_{i},\widetilde{D}_{i}] =0,\) $var[ _{i}]=_{}^{2} $, \(var[ V_{i}]=\sigma _{V}^{2},\) and where we therefore actually run the regression: \[ Y_{i}=D_{i}\beta +U_{i}. \]
Demonstrate that there is “attenuation bias” in \(\widehat{\beta }_{OLS}\);
Now suppose that the true specification is given by: \[ Y_{i}=\widetilde{D}_{i}\beta +X_{i}\alpha +U_{i}, \] where \(X_{i}\) is a covariate, and where \(cov\left[ D_{i},X_{i}\right] \neq 0,\) \(cov\left[U_{i},X_{i}\right] =0\).
Determine the large sample bias (i.e. the \(plim\)) in \(\widehat{\beta }_{OLS}\) and \(\widehat{\alpha}_{OLS}\) when we run \(Y_{i}=D_{i}\beta+X_{i}\alpha +U_{i}\);
Does the Iron Law of Econometrics hold for \(\widehat{\beta }_{OLS}?\) Is the bias larger or smaller when there is a covariate \(X_{i}?\) What can you say when \(cov\left[ X_{i},V_{i}\right] =0?\)
5.4.2 To wrongs can make a right
Griliches and Hausman (1986)
Now forget about the PNIR and suppose that you want to estimate the impact of a child’s age (AGENF) on WAZ. Do this using the within-child and first-difference estimators. Now it could be that a child’s age is measured with error, because it is self-reported by the household head. Compute the Griliches and Hausman (1986) estimator of the effect, where you will obviously have to restrict your attention to the subset of observations for which \(t\geq3\).
 Your goal is to estimate the impact of being eligible for a PNIR project (LPNIR) on a child’s HAZ. The within-child estimate of this effect should be approximately 0.545 with a \(p-\)value of 0.038 when you cluster your standard errors at the village (CODEVILL) level. Include the same covariates as in Problem Set No. 2.} Note that this effect is quite large since the mean value of the HAZ in the sample is \(-1.196\) (\(-1.235\)) in the subset of children observed at least twice), so being eligible for the PNIR essentially halves stunting.
Now imagine that you were unable} to follow children over time (i.e. you did not have the child identifier IDENF), and were forced to find some other manner ofcontrolling for time-invariant child characteristics. One manner of doing so would be to implement the Verbeek and Nijman (1993) pseudo-panel estimator. The time-invariant characteristics you will use to construct the cohorts are the child’s gender (FEMALE) and her/his date of birth (remember that the child’s age in months is given by AGENF).
USE ANSWERS FROM 2018 FINAL EXAM
USE XINCHEN’S CODE FOR HER INEQUALITY OF OPPORTUNITY PAPER
5.6 Synthetic control
Abadie, Diamond, and Hainmueller (2015)
References
Hausman, Jerry A., and W. Taylor. 1981. “Panel Data and Unobservable Individual Effects.” Econometrica 49 (6): 1377–98.
Mundlak, Yair. 1978. “On the Pooling of Time Series and Cross Section Data.” Econometrica 46 (1): 69–85.
Lancaster, T. 2000. “The Incidental Parameter Problem Since 1948.” Journal of Econometrics 95 (2): 391–413.
Semykina, Anastasia, and Jeffrey M. Wooldridge. 2010. “Estimating Panel Data Models in the Presence of Endogeneity and Selection.” Journal of Econometrics 157 (2): 375–80.
Bertrand, Marianne, Esther Duflo, and Sendhil Mullainathan. 2004. “How Much Should We Trust Differences-in-Differences Estimates?” Quarterly Journal of Economics 119 (1): 249–75.
Cameron, Colin A., Jonah B. Gelbach, and Douglas L. Miller. 2008. “Bootstrap-Based Improvements for Inference with Clustered Standard Errors.” Review of Economics and Statistics 90 (3): 414–27.
Young, Alwyn. 2016. “Improved, Nearly Exact, Statistical Inference with Robust and Clustered Covariance Matrices Using Effective Degrees of Freedom Corrections.”
Hausman, Jerry A. 2001. “Mismeasured Variables in Econometric Analysis: Problems from the Right and Problems from the Left.” Journal of Economic Perspectives 15 (4): 57–67.
Griliches, Zvi, and Jerry A. Hausman. 1986. “Errors in Variables in Panel Data.” Journal of Econometrics 31 (1). Elsevier: 93–118.
Lewbel, A. 2012. “Using Heteroskedasticity to Identify and Estimate Mismeasured and Endogenous Regressor Models.” Journal of Business and Economic Statistics 30 (1): 67–80.
Dagenais, M. G., and D. L. Dagenais. 1997. “Higher Moment Estimators for Linear Regression Models with Errors in the Variables.” Journal of Econometrics 76 (1-2): 193–221.
Verbeek, Marno, and Theo Nijman. 1993. “Minimum MSE Estimation of a Regression Model with Fixed Effects from a Series of Cross-Sections.” Journal of Econometrics 59 (1-2): 125–36.
Abadie, Alberto, Alexis Diamond, and Jens Hainmueller. 2015. “Comparative Politics and the Synthetic Control.” American Journal of Political Science 59 (2): 495–510.


The validatingconfigparser module provides the class ValidatingMixIn which is meant to be used as a mix-in class for the RawConfigParser, ConfigParser and SafeConfigParser classes found in the Python Standard Library. It extends the get(), getint(), getfloat(), getboolean() and set() methods by an additional keyword argument validator. This validator can be used to ensure that the value returned or given as argument to above methods passes a validation test. The validator must be an instance of a class that provides the same methods as the validators of the Formencode project. In fact, ValidatingMixIn was specifically designed to use the Formencode.validators.
from ConfigParser import ConfigParser
from validatingconfigparser import ValidatingMixIn
from formencode.validators.import OneOf
# Ensure that the value is either 1, 2 or 3.
validator = OneOf([1, 2, 3])
# Create a new parser with the ValidatingMixin.
class ValidatingConfigParser(ValidatingMixIn, ConfigParser):
pass
parser = ValidatingConfigParser()
parse.read("settings.conf")
# Below will raise formencode.Invalid if validation fails.
parser.get("name", "section", validator=validator)
As it may be tedious to create your own validating ConfigParser sub-class as shown above, the validatingconfigparser module already provides validating variants of the original parsers for convenience. These parsers can be used as direct replacements of the original parsers as their API is compatible.
In addition the __init_() methods of the validating parser listed above accepts a schema keyword argument which must be an instance of a Formencode.Schema class.
Contents:


Game of Nim
Will Bennion (22925040)
One sec, we're working on it...
You have been disconnected from the server.


---
layout: main
title: Themes
keywords:
- Themes
- Reborn
- Dark Matter
- Transparent
- Light
- Quiet
- Color
- Clear Vision
- Material Design
- Flat
- Anime
- Background
- Animations
---
{% assign themes = "|" | split: "|" %}
{% for file in site.pages %}
{% if file.layout == "theme" and file.hidden != true %}
{% assign themes = themes | push: file %}
{% endif %}
{% endfor %}
Themes
Pay for a custom and beautiful theme now!
{{e.description}}


class MyArea
Data class storing details of the nearest waterbody(including characteristics), water quality sampling point and pollution permit holder
See Also
WIMSPointDischargePermitPointCDEPointCharacteristic
| <init> |
MyArea()
Data constructor which initialises all properties to null |
| getCharacteristicList |
fun getCharacteristicList(): java.util.ArrayList<com.epimorphics.android.myrivers.data.Characteristic> |
| getHasWaterbody |
fun getHasWaterbody(): java.lang.Boolean |
| getManagementCatchment |
fun getManagementCatchment(): java.lang.String |
| getOperationalCatchment |
fun getOperationalCatchment(): java.lang.String |
| getPermitPoint |
fun getPermitPoint(): com.epimorphics.android.myrivers.data.DischargePermitPoint |
| getRiverBasinDistrict |
fun getRiverBasinDistrict(): java.lang.String |
| getWIMSPoint |
fun getWIMSPoint(): com.epimorphics.android.myrivers.data.WIMSPoint |
| getWaterbody |
fun getWaterbody(): java.lang.String |
| setCharacteristicList |
fun setCharacteristicList(): void |
| setHasWaterbody |
fun setHasWaterbody(): void
If no waterbody found add true to isDataLoaded to allow listener to fire when the rest of the data is loaded |
| setManagementCatchment |
fun setManagementCatchment(): void |
| setOnPopulatedListener |
fun setOnPopulatedListener(): void |
| setOperationalCatchment |
fun setOperationalCatchment(): void |
| setPermitPoint |
fun setPermitPoint(): void
If the nearest for all CDE, WIMS and EPR is loaded fire the listener.onMyAreaPopulated() |
| setRiverBasinDistrict |
fun setRiverBasinDistrict(): void
If the nearest for all CDE, WIMS and EPR is loaded fire the listener.onMyAreaPopulated() |
| setWaterbody |
fun setWaterbody(): void |
| setWimsPoint |
fun setWimsPoint(): void
If the nearest for all CDE, WIMS and EPR is loaded fire the listener.onMyAreaPopulated() |


History Learner
If you want to know the utility of this project, you should see
why we done this?
Learn from my history


This is a command-line argument parser which wraps the powerful Perl module Getopt::Long
and with some adaptations for easier use in R. It also provides a simple way for variable interpolation in R.
There are two vignettes in the package which explain in more detail:
The package can be installed from CRAN:
install.packages("GetoptLong")
or directly from GitHub:
devtools::install_github("jokergoo/GetoptLong")
This package wraps the powerful Perl module Getopt::Long
and keeps almost all features of it. The syntax of option specification is the same as Getopt::Long
. So if you are from Perl and you know Getopt::Long
, there would be no difficulty with using it.
The usage is very simple:
library(GetoptLong)
cutoff = 0.05
GetoptLong(
"number=i", "Number of items.",
"cutoff=f", "Cutoff for filtering results.",
"verbose!", "Print message."
)
Then you can run this script by:
~\> Rscript foo.R --number 4 --cutoff 0.01 --verbose
~\> Rscript foo.R --number=4 --cutoff=0.01 --no-verbose
~\> Rscript foo.R -n 4 -c 0.01 -v
~\> Rscript foo.R -n 4 --verbose
Help message is automatically generated:
Usage: Rscript foo.R [options]
Options:
--number, -n integer
Number of items.
--cutoff, -c numeric
Cutoff for filtering results.
[default: 0.05]
--verbose
Print message.
--help, -h
Print help message and exit.
--version
Print version information and exit.
This package also supports simple variable interpolation, which means you can embed variables into texts directly, just like in Perl.
r = c(1, 2)
value = 4
name = "name"
qq("region = (@{r[1]}, @{r[2]}), value = @{value}, name = '@{name}'")
## [1] "region = (1, 2), value = 4, name = 'name'"
So it would be much easier for you to construct complicated texts instead of using paste()
.


--- layout: page tagline: ---
Aoqian Zhang is currently a Post Doctoral Fellow in data system group, Cheriton School of Computer Science, University of Waterloo, under supervison of Prof. Ihab Francis Ilyas. He received his Ph.D in 2018 in Software Engineering from School of Software, Tsinghua University, under supervision of Prof. Jianmin Wang and Prof. Shaoxu Song. He received his B.E. in 2013 in Computer Software from School of Software, Tsinghua University.
Data Cleaning, Data Imputation and Temporal Anomaly Detection.
[ICDE] Aoqian Zhang, Shaoxu Song*, Yu Sun, Jianmin Wang, "Learning Individual Models for Imputation", 35th IEEE International Conference on Data Engineering(ICDE), Macao, China, April 8-11, 2019, pp.160-171 [PDF][Code@Github]
[PVLDB] Aoqian Zhang, Shaoxu Song*, Jianmin Wang, Philip S. Yu, "Time Series Data Cleaning: From Anomaly Detection to Anomaly Repairing", PVLDB 10(10): 1046-1057 (2017) [PDF][Code@Github]
[ACM SIGMOD'16] Aoqian Zhang, Shaoxu Song*, Jianmin Wang, "Sequential Data Cleaning: A Statistical Approach", ACM SIGMOD Conference, San Francisco, USA, June 26 - July 1, 2016 [PDF][Code@Github]
[PVLDB] Shaoxu Song*, Aoqian Zhang, Lei Chen, Jianmin Wang, "Enriching Data Imputation with Extensive Similarity Neighbors", PVLDB 8(11): 1286-1297 (2015) [PDF]
[ACM SIGMOD'15] Shaoxu Song*, Aoqian Zhang, Jianmin Wang, Philip S. Yu "SCREEN: Stream Data Cleaning under Speed Constraints", ACM SIGMOD Conference, Melbourne, VIC, Australia, May 31 - June 4, 2015 [PDF][Code@Github]
Tsinghua Zi Jing Scholar (for counsellor who do fantastic job in research)
2017, 2014, First-class Scholarship (Glodon Scholarship), Tsinghua University
2016, Tsinghua Lin Feng Counsellor Prize (highest honor to counsellors of undergraduates)
2015, National Scholarship, Tsinghua University
2015, Excellent Communist Party Member of Master in Tsinghua
2013, Data transfer group champion, Solve for tomorrow, National Youth Science Innovation Experiment Competition
TsQuality.
A project develops data quality tools for large scale time series data, including data profiling, anomaly detection and data repairing. It is one of the projects in the National Engineering Laboratory for Big Data Software(NEL-BDS)


Finance: Initial Allocations
Initial Allocations Application is now live! Please click here to get access to the spreadsheet. Your organization will need to submit the ESC Affiliation Application and get approval to be an ESC Affiliated Organization to receive the Initial Allocations funds.
Both Applications are due on April 26th at 11:59PM.


Before Change
config = yaml.load(fp)
feature_extraction_name = config["feature_extraction"]["name"]
features = __import__("pyannote.audio.features",
fromlist=[feature_extraction_name])
FeatureExtraction = getattr(features, feature_extraction_name)
feature_extraction = FeatureExtraction(
**config["feature_extraction"].get("params", {}))
sliding_window = feature_extraction.sliding_window
After Change
dimension = feature_extraction.dimension
if "normalization" in config:
FeatureNormalization = get_class_by_name(
config["normalization"]["name"],
default_module_name="pyannote.audio.features.normalization")
normalization = FeatureNormalization(
**config["normalization"].get("params", {}))
else:
normalization = None


Instructions:
In this proficiency exercise you are required to search for a particular element using the concepts of Linear Indexing. The solution for this exercise is achieved by a step wise search. The first step is to search for the first key value in the second level index array. The second step will be to select the appropriate block in the index file. The final step is a simple search through the array records to reach your answer.
Element to Search:


Building a Yeoman generator
I'm taking a quick break from the shiny land of CSS animations. Back to the black and white (or green and white, or whatever your console colors are) land of workflow automation, with a quick explanation of what it took to build my first generator for Yeoman: generator-playground.
A bit of context
I got tired of always repeating the same steps when I wanted to make a quick HTML/CSS/JS experiment or example. JSBin, JSFiddle and the like are great online tools, but sometimes, I prefer my good ol' text editor on my machine. This was a great pretext to finally give a good go at Yeoman and see if it could help me automatically scaffold a few things here (that's what it's meant for after all).
My requirements where pretty limited (it was my first go with Yeoman after all):
- create an HTML, CSS and JS file with the appropriate
<link>
and<script>
tag to glue them together - optionally include
normalize.css
andjQuery
if asked for - have a Grunt build providing an Express server to host the projects file, and most importantly livereload
- create a Git repo, so I can tag specific steps in an example or just in case what started as an experiment finally grows bigger (I could probably have added a question for this)
This was already enough to get a nice overview of how Yeoman works and various features to build a generator.
A quick try ?
Curious and want to give the final a try? That can easily be arranged! You'll need node.js on your machine, one shell command (might need to sudo
), and that's about it for the installation:
$ npm install -g generator-playground
The generator relies on Yeoman (obviously), Grunt and Bower to work properly. They will get installed along if you don't have them already (yeah for the peerDependencies
property of package.json
!!!).
Once you've got the generator installed, head over to the folder you want to create the files in and go:
$ yo playground
This should have got you ready to hack: the project files have been created in the folder, and if you run grunt server
, the server hosting the project will star and your browser should open (a new tab, maybe) http://localhost:9000
.
A look under the hood
For those of you who made it back safely to the article and didn't get stuck hacking on the project they just generated, here comes the details on how things work (not necessarily in the order I got them to work).
Getting started
Getting a project for a Yeoman generator started was really quick. Yeoman is a project to scaffold stuff, so they've got something to scaffold a Yeoman generator project: generator-generator
. A quick npm
and yo
commands later, I had a skeleton for my generator project.
Testing it out
Good code is tested code, and I didn't want the generator to escape this mantra. The generated project came with a couple of test samples in the test
folder. They where pretty handy to discover the helpers for running the generator from inside a test, simulating prompt answers or assert that files get copied properly.
The "Run the generator with a set of prompt answers and validate what comes out in the output folder" seemed to be a good enough strategy, as my generator didn't have too many options. Makes a nice little test suite that can be run by Travis CI.
Prompting the user
This is something I find really awesome: fancy command line prompts. Not just asking your user "Hey, what's your name?", but providing defaults, having different kind of prompts (command line checkboxes, anyone?)... I find this definitely more enjoyable than forcing your user to pass a heavy sequence arguments (though, you probably want to have both).
And it's even more enjoyable when your generator class already has that built in a handy prompt()
method. I didn't get to go too fancy for the playground generator, though, only a couple of yes/no questions were required.
Generating the project files
This is definitely the main task of a Yeoman generator: creating files, folders... The strategy here seems to be to have a templates
directory in your project, from which your generator will copy the files to whatever destination they're supposed to end up at (your generator has a handy copy()
method just for that).
Sometimes, you'll want to do a bit more than a plain copy, maybe include/exclude parts of the files according to the answers of the prompt(s). That's when the template()
method comes in. It uses your files as a template (underscore flavour, I think) for what will get in the destination file.
Git setup
The git repository setup (creating a repo and making a first commit with the project files) was the occasion to play a bit with the async library to coordinate calls to the git
CLI. The massive one liner I had in mind apparently didn't cut it :(. This last step made the generator complete (at least for now).
Wrapping it up
Building this generator ended up being a great way to discover Yeoman and how it makes its scaffolding happen. Hopefully, I'll get to extend this first project with a few dream features I had to leave aside: support for preprocessor, CSS & JS linting or even getting rid of the dependency for grunt and bower (to scaffold project offline).
Thanks for reading this till the end, I hope you enjoyed it, learnt little tricks or maybe got ideas for your own Yeoman generator. Happy coding ;)